Data Analytics Lab 7
Lab 7 Data Instructions.docx
7-2 Lab 7: Regression
Assignment
You must complete both parts of this lab to receive credit:
· Part A: Linear Regression
· Part B: Logic Regression
In order to complete this assignment, you will need to download a copy of the Lab 7 document, enter your responses (the areas highlighted in yellow), and submit your completed file as a Word document. Add your last name to the filename of the document you submit (for example, Britton_Lab_7.docx). You will also need the following files:
· Ols.R
· Logit.R
· Survey.csv
This is a pass/fail assignment.
dat_510_lab_7.docx
Lab Exercise 7 – Regression
NOTE: There are TWO parts to this lab:
· Part A: Linear Regression
· Part B: Logic Regression
BOTH parts must be completed to receive full credit for the lab!
Part A: Linear Regression
|
Purpose:
|
This lab is designed to investigate and practice the Linear Regression method. After completing the tasks in this lab you should able to: · Use R functions for Linear Regression (Ordinary Least Squares – OLS) · Predict the dependent variables based on the model · Investigate different statistical parameter tests that measure the effectiveness of the model |
|
|
|
|
Tasks: |
Tasks you will complete in this lab include: · Use the R –Studio environment to code OLS models · Review the methodology to validate the model and predict the dependent variable for a set of given independent variables · Use R graphics functions to visualize the results generated with the model |
|
|
|
|
References: |
References used in this lab are located in your Student Resource Guide Appendix . |
Workflow Overview
LAB Instructions
|
Step |
Action |
|
1 |
Download the following file from D2L: · Ols.R
|
|
2 |
Set Working directory Set the working directory to <YOUR DIRECTORY> by executing the command:
setwd("<YOUR DIRECTORY>")
· (Or using the “Tools” option in the tool bar in the RStudio environment). |
|
3 |
Use random number generators to create data for the OLS Model :
1. Run the “runif” function in R which generates random deviates within the specified minimum and maximum range. x <- runif(100, 0, 10) |
|
4 |
Generate the OLS model using R function “lm”:
An OLS Model is generated with an R function call “lm”. You can learn about “lm” with the following command on the console:
?lm
1. Generate an OLS Model using the following command: d <- lm(y ~ x)
2. You can see the details of the fitted model. What are the values of the coefficients (Beta) in the model?
3. Use the following command to display the structure of the object “d” created with the function call “lm” str(d)
|
|
5 |
Print and visualize the results and review the plots generated 1. Get the compact results of the model with the following command: print(d)
2. Visualize the model with the command: par(mfrow=c(2,2)) plot(d)
The explanation of the plots are as follows: Residuals vs. Fitted: you want to make sure that the errors are evenly distributed over the entire range of fitted values; if the errors are markedly larger (or biased either positively or negatively) in some range of the data, this is evidence that this model may not be entirely appropriate for the problem.Q-Q plot: tests whether or not the errors are in fact distributed approximately normally (as the model formulation assumes). If they are, the Q-Q plot will be along the x=y line. If they aren't, the model may still be adequate, but perhaps a more robust modeling method is suitable. Also, the usual diagnostics (R-squared, t-tests for significance) will not be valid.Scale-Location: a similar idea to Residuals v. Fitted; you want to make sure that the variance (or its stand-in, "scale") is approximately constant over the range of fitted values.Residuals vs. Leverage: used for identifying potential outliers and "influential" points. Points that are far from the centroid of the scatterplot in the x direction (high leverage) are influential, in the sense that they may have disproportionate influence on the fit (that doesn't mean they are wrong, necessarily). Points that are far from the centroid in the y direction (large residuals) are potential outliers. |
|
6 |
Generate Summary Outputs:
1. For more detailed results type: d1 <- summary(d) print(d1)
Read the explanations given below from the summary output and note the values from the output on the console for each statistic detailed:
coefficients : the estimated value of each coefficient, along with the standard error. coefficient +/- 2*std.error is useful as a quick measure of confidence interval around the estimate.
t-value: coefficient/std.error, or how tight an estimate this is (compared to 0). If the "true" coefficient is zero (meaning this variable has no effect on the outcome), t-value is "small".
Pr(>|t|): the probability of observing this t-value if the coefficient is actually zero. You want this probability to be small. How small depends on the significance desired. Standard significances are given by the significance codes. So, for example "***" means that the probability that this coefficient is really zero is negligible.
R-squared: A goodness of fit measure: the square of the correlation between predicted response and the true response. You want it close to 1. Adjusted R-squared compensates for the fact that having more parameters tends to increase R-squared. Since we only have one variable here, the two are the same.
F-statistic and p-value. Used to determine if this model is actually doing better than just guessing the mean value of y as the prediction (the "null model"). If the linear model is really just estimating the same as the null model, then the F-statistic should be about 1. The p-value is the probability of seeing an F-statistic this large, if the true value is 1. Obviously, you want this value to be very small.
1. Type in the following command: > cat("OLS gave slope of ", d1$coefficients[2,1],
"and an R-sqr of ", d1$r.squared, "\n")
2. Note the result you see on the console in the space below:
|
|
7 |
Introduce a slight non-linearity and test the model:
1. Create a “training” data set First the training set in which we will introduce a slight non-linearity. > x1 <- runif(100)> # introduce a slight nonlinearity> y1 = 5 + 6*x1 + 0.1*x1*x1 + rnorm(100)2. Generate the model> m <- lm(y1 ~ x1) |
End of Lab Exercise
20
Part B: Logistic Regression
|
Purpose:
|
This lab is designed to investigate and practice the Logistic Regression method. After completing the tasks in this lab you should able to: · Use R functions for Logistic Regression – also known as Logit) · Predict the dependent variables based on the model · Investigate different statistical parameter tests that measure the effectiveness of the model |
|
|
|
|
Tasks: |
Tasks you will complete in this lab include: · Use R –Studio environment to code Logit models · Review the methodology to validate the model and predict the dependent variable for a set of given independent variables · Use R graphics functions to visualize the results generated with the model |
|
|
|
|
References: |
References used in this lab are located in your Student Resource Guide Appendix. |
Workflow Overview
LAB Instructions
|
Step |
Action |
|
1 |
Download files from D2L: · Logit.R · Survey.csv
|
|
2 |
Set the Working Directory Set the working directory to <YOUR DIRECTORY> by executing the command:
setwd(“<YOUR DIRECTORY>")
· (Or using the “Tools” option in the tool bar in the RStudio environment). |
|
3 |
Define the problem and review input data
Logistic Regression, also known as Logit , is typically used in models where the dependent variables have a binary outcome (True/False, which is coded with 1/0). You model the log odds of the outcome as a linear combination of predictor variables).
Marketing Survey Data In this lab you use hypothetical marketing survey data in which customers: · Responded to the question: · Would you choose a product based on a “pricing” factor (three “Price” ranges 10, 20 and 30)? · Response options: · “1” for “yes” and “0” for “no” · The survey also collected information such as “Age” and “Income” of the respondent.
Business Need The marketing campaign team wants to send special offers to those respondents with the highest probability of purchase.
You sould have downloaded the data file from D2L. If you have not done this yet, do so now: survey.csv.
1. Review the survey.csv file. 2. How many responses to the survey does the file contain?
3. What is the main purpose of building this model?
|
|
4 |
Read in and Examine the Data:
1. The first step in the modeling process is to examine the data and determine if there are any outliers. To do this you must read in the survey data, use the following command:
Mydata <- read.csv("survey.csv",header=TRUE,sep=",")
2. With the following command, explore the data further:
> table(Mydata$MYDEPV) > with(Mydata, table(Price,MYDEPV)) > summary(Mydata$Age) > cor.mat <- cor(Mydata[,-1]) > cor.mat 3. Review the results on the console
Note: The general rule is not to include variables in your model that are too highly correlated with other predictors. For example, including two variables that are correlated by 0.85 in your model may prevent the true contribution of each variable from being identified by the statistical algorithm. Confirm that the variables in our survey do not fall in this category.
|
|
5 |
Build and Review Logistic Regression Model:
1. Use the “glm” function for logit modeling. Type in the following command:
mylogit <- glm(MYDEPV ~ Income + Age + as.factor(Price) , data=Mydata,family=binomial(link="logit"), na.action=na.pass) 2. Review the model by typing the “summary” and “plot” functions: summary (mylogit)
Review the results of the summary command, for the fitted model, on the console. Results you should see: · The first line provides the model you specified. · Next, you should see the deviance residuals, which provide the measure of the model fit. · The next part of the output shows the coefficients, their standard errors, the z-statistic (sometimes called a Wald z-statistic), and the associated p-values. · Both Income and Age are statistically significant, as are the two terms for Price. · The logistic regression coefficients show the change in the log odds of the outcome for a one unit increase in the predictor variable. · Residual deviance: analogous to the Residual Sum of Squares of a linear model; that is, it is related to the "total error" of the fit. It is twice the negative log likelihood of the model. · Null deviance: the deviance associated with the "null model" -- that is the model that returns just the global probability of TRUE for every x. The quantity 1 - (Residual deviance/Null deviance) is sometimes called "pseudo-R-squared"; you use it to evaluate goodness of fit in the same way that R-sqr is used for linear models.
The interpretation of the results are as follows: 1. Review the “Estimate” column. For every one unit change in Income, the log odds of Purchase (versus no-Purchase) increases by 0.12876. 2. Record the number that describes how much one unit increase in Age increases the log odds of purchase: The indicator variables for Price are interpreted differently. For example, Purchase decision at a Price of 20, compared with a Price of 10, decreases the log odds of admission by 0.74418 3. Record the log odds at Price point 30 compared to Price point 10 below: |
|
6 |
Review the results and interpret the coefficients
1. Use the “confint” function to obtain the confidence intervals of the coefficient estimates: confint(mylogit)
|
|
7 |
Visualize the Model Using the Plot Function:
plot(mylogit)
You should see multiple plots generated on the graphics window. |
|
8 |
Use relevel Function to re-level the Price factor with value 30 as the base reference . In the original model that we fitted with the function call:
mylogit <- glm(MYDEPV ~ Income + Age + as.factor(Price) , + data= Mydata,family=binomial(link="logit"), + na.action=na.pass)
we obtained the results shown below: Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -6.02116 0.53244 -11.309 < 2e-16 *** Income 0.12876 0.00923 13.950 < 2e-16 *** Age 0.03506 0.01179 2.974 0.00294 ** as.factor(Price)20 -0.74418 0.26439 -2.815 0.00488 ** as.factor(Price)30 -2.21028 0.31108 -7.105 1.2e-12 *** ---
What does this tell us?
The odds of MYDEPV decreases when price changes from 10 to 20 and decreases even more when we go from 10 to 30.
1. Now let's use 30 as the reference price, instead of 10. Type in the following:
Mydata$pricefactor = relevel(as.factor(Mydata$Price), "30")
|
|
8 Cont. |
Fit the Model Again (mylogit2) and Display the Summary: mylogit2 = glm(MYDEPV ~ Income + Age + pricefactor , + data= Mydata,family=binomial(link="logit"), + na.action=na.pass) summary(mylogit2)
You will see the results as follows: Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -8.23144 0.66180 -12.438 < 2e-16 *** Income 0.12876 0.00923 13.950 < 2e-16 *** Age 0.03506 0.01179 2.974 0.00294 ** pricefactor10 2.21028 0.31108 7.105 1.20e-12 *** pricefactor20 1.46610 0.29943 4.896 9.76e-07 *** ---
Notice that the intercept has changed (because we changed the reference situation), but the coefficients for Income and Age are the same. The new model tells us that the odds of MYDEPV increase when price decreases from 30 to 10, and less so price decreases from 30 to 20.
|
|
9 |
Plot the ROC Curve:
1. Make sure you have the package ROCR installed and the library included
install.packages("ROCR")
library(ROCR)
2. First get all the probability scores on the training data pred = predict(mylogit, type="response")
3. Every classifier evaluation using ROCR starts with creating a prediction object. This function is used to transform the input data (which can be in vector, matrix, data frame, or list form) into a standardized format. We create the prediction object needed for ROCR as follows: predObj = prediction(pred, Mydata$MYDEPV)
4. All kinds of predictor evaluations are performed using the function “performance”. Read and understand the parameters of the function with
?performance
5. We now create the ROC curve object and the AUC object with performance function
rocObj = performance(predObj, measure="tpr", x.measure="fpr") # creates ROC curve obj aucObj = performance(predObj, measure="auc") # auc object
6. Extract the value of AUC and display on the console: auc = [email protected][[1]]
auc
7. What is the value of AUC?
8. We will plot the ROC curve now
plot(rocObj, main = paste("Area under the curve:", auc))
9. Review the curve on the plot window. Review the discussions on ROC in the student resources guide. Record your observations below:
|
|
10 |
Predict Outcome given Age and Income:
1. Use the “predict” function to predict the probability of the purchase outcome given Age and Income. Start with predicting the probability of the purchase decision at different Price points (10, 20, and 30). Create a “data frame” called “newdata1” using the following commands:
Price <- c(10,20,30) Age <- c(mean(Mydata$Age)) Income <- c(mean(Mydata$Income)) newdata1 <- data.frame(Income,Age,Price) newdata1
You are predicting with Income and Age both set at their mean value and Price at 10, 20 and 30.
Note: The values of the data frame “newdata1” displayed on the console. The predict function requires the variables to be named exactly as in the fitted model.
2. Create the fourth variable “PurchaseP”.
newdata1$PurchaseP <- predict (mylogit,newdata=newdata1,type="response") newdata1 |
|
11 |
Predict outcome for a sequence of Age values at price 30 and income at its mean:
1. Keep the Price at 30, Income at its mean value and select a sequence of values for Age starting at a minimum age, incrementing by 2 until the maximum age in our dataset:
newdata2 <- data.frame(Age=seq(min(Mydata$Age),max(Mydata$Age),2), Income=mean(Mydata$Income),Price=30) newdata2$AgeP<-predict(mylogit,newdata=newdata2,type="response") cbind(newdata2$Age,newdata2$AgeP)
Newdata2$AgeP stores the predicted variables and you just display the sequence for Age you generated and the corresponding probability of the purchase decision using the “cbind” function shown above.
2. Plot and visualize how the “purchase” probability varies with Age:
plot(newdata2$Age,newdata2$AgeP)
|
|
12 |
Predict outcome for a sequence of income at price 30 and Age at its mean:
1. Using the same methodology, create a data frame newdata3 with the following characteristics: · Income is a sequence from 20 to 90 in steps of 10 · Age is the mean value for the dataset Mydata · Price point at 30
2. Predict newdata3$IncomeP and display the Income sequence along with the predicted probabilities. 3. Plot the results.
|
|
13 |
Use Logistic regression as a classifier:
Recall the problem statement in Step 3, the marketing campaign team wants to send special offers to those respondents with the highest probability of purchase. They have established a threshold of 0.5 and they want to target customers whose probability of purchase are greater than 0.5.
Note: We are assuming that age and income are uniformly distributed in our customer base, and the price factors of our products are also uniformly distributed. Typically in order to run a scenario like this you should understand the demographic distribution of the customers (and the price distribution of the products).
1. You want an idea of how many offers will be sent out, using this threshold, so you test it on a 'random' set of data. First, generate this random set using “runif” functions:
newdata4 <- data.frame ( Age= round(runif(10,min(Mydata$Age),max(Mydata$Age))), Income=round(runif(10,min(Mydata$Income),max(Mydata$Income))), Price = round((runif(10,10,30)/10))*10) newdata4$Prob <- predict(mylogit,newdata=newdata4,type="response") newdata4
2. How many samples in your random selection qualify for special offers?
|
End of Lab Exercise – Part B
1
Set Working directory
Use random number generators to create data for the OLS Model
Generate the OLS model using R function “lm”
Print and visualize the results and review the plots generated
Generate Summary Outputs
Introduce a slight non-linearity and test the model
Perform In-database Analysis of Linear Regression
2
3
4
5
6
7
1
Set the Working Directory
2
3
Read in and Examine the Data
4
Build and Review logistic regression Model
5
Define the problem and review input data
Review and interpret the coefficients
6
Visualize the Model Using the Plot Function
7
Use relevel Function to re-level the Price factor with value 30 as the base reference
8
Plot the ROC Curve
9
Predict Outcome given Age and Income
10
Predict outcome for a sequence of Age values at price 30 and income at its mean
11
Predict outcome for a sequence of income at price 30 and Age at its mean
12
Use Logistic regression as a classifier
MOD7/logit.R
# Module Seven: Lab 5 - Part B: Logistic Regression #Logit setwd("D:/Users/XXUserXX/Desktop/DAT-510/MOD7/") Mydata <- read.csv("survey.csv",header=TRUE,sep=",") #Explore data table(Mydata$MYDEPV) with(Mydata, table(Price,MYDEPV)) summary(Mydata$Age) cor.mat <- cor(Mydata[,-1]) cor.mat # test a model with 3 variables Price, Income and Age mylogit <- glm(MYDEPV ~ Income + Age + as.factor(Price), data =Mydata, family=binomial(link="logit"), na.action=na.pass) summary(mylogit) confint(mylogit) exp(mylogit$coefficients) #Pseudo R2 attributes(mylogit) 1-with(mylogit,deviance/null.deviance) #Visualize the Model plot(mylogit) # relevel excercise # we will now change the refernce level at price point 30 Mydata$pricefactor = relevel(as.factor(Mydata$Price), "30") mylogit2 = glm(MYDEPV ~ Income + Age + pricefactor , data= Mydata,family=binomial(link="logit"), na.action=na.pass) summary(mylogit2) # ROC Curve install.packages("ROCR") library(ROCR) pred = predict(mylogit, type="response") # this returns the probability scores on the training data predObj = prediction(pred, Mydata$MYDEPV) # prediction object needed by ROCR rocObj = performance(predObj, measure="tpr", x.measure="fpr") # creates ROC curve obj aucObj = performance(predObj, measure="auc") # auc object auc = [email protected][[1]] auc # the auc score # plot the roc curve plot(rocObj, main = paste("Area under the curve:", auc)) #Prediction - 1 Price <- c(10,20,30) Age <- c(mean(Mydata$Age)) Income <- c(mean(Mydata$Income)) newdata1 <- data.frame(Income,Age,Price) newdata1 newdata1$PurchaseP <- predict (mylogit,newdata=newdata1,type="response") newdata1 #Prediction - 2 newdata2 <- data.frame(Age=seq(min(Mydata$Age),max(Mydata$Age),2), Income=mean(Mydata$Income),Price=30) newdata2$AgeP<-predict(mylogit,newdata=newdata2,type="response") cbind(newdata2$Age,newdata2$AgeP) plot(newdata2$Age,newdata2$AgeP) #Prediction - 3 newdata3 <- data.frame(Income= seq(20,90,10),Age=mean(Mydata$Age),Price=30) newdata3$IncomeP<-predict(mylogit,newdata=newdata3,type="response") cbind(newdata3$Income,newdata3$IncomeP) plot(newdata3$Income,newdata3$IncomeP) #Prediction 4 newdata4 <- data.frame (Age= round(runif(10,min(Mydata$Age),max(Mydata$Age))), Income= round(runif(10,min(Mydata$Income),max(Mydata$Income))), Price = round((runif(10,10,30)/10))*10) newdata4$Prob <- predict(mylogit,newdata=newdata4,type="response") newdata4 #Pull results only for samples that qualify (Prob > .50) send <- subset(newdata4,newdata4$Prob >= 0.5) dim(send)
MOD7/ols.R
# Module Seven: Lab 5 - Part A: Linear Regression setwd("D:/Users/XXUserXX/Desktop/DAT-510/MOD7/") x <- runif(100, 0, 10) # 100 draws between 0 & 10 y <- 5 + 6*x + rnorm(100) # beta = [2, 3] and sigma = 1 #Plot it plot (x,y) # OLS model d <- lm(y ~ x) # Learn about this object by saying ?lm and str(d) # Compact model results -- print(d) # Pretty graphics for regression diagnostics -- par(mfrow=c(2,2)) plot(d) ypred <- predict(d) par(mfrow=c(1,1)) plot(y,y, type="l", xlab="true y", ylab="predicted y") points(y, ypred) d1 <- summary(d) # Detailed model results -- print(d1) # Learn about this object by saying ?summary.lm and by saying str(d) cat("OLS gave slope of ", d1$coefficients[2,1], "and an R-sqr of ", d1$r.squared, "\n") x1 <- runif(100) # introduce a slight nonlinearity y1 = 5 + 6*x1 + 0.1*x1*x1 + rnorm(100) m <- lm(y1 ~ x1) x2 <- runif(100) y2 = 5 + 6*x2 + 0.1*x2*x2 + rnorm(100) y2pred <- predict(m,data.frame(x2)) par(mfrow=c(1,1)) plot(y2,y2, type="l", xlab="true y", ylab="predicted y") points(y2, y2pred)
MOD7/survey.csv
MYDEPV,Price,Income,Age 1,10,33,37 0,20,21,55 1,30,59,55 1,20,76,44 0,30,24,37 0,20,22,32 1,10,28,32 1,10,49,38 0,30,76,43 1,20,59,55 0,30,45,32 0,30,21,46 0,30,49,44 0,10,23,30 1,10,55,55 0,20,29,32 1,10,49,44 0,20,45,32 0,20,24,37 0,10,30,32 0,10,24,55 1,10,59,55 0,30,31,32 0,20,33,32 0,30,22,32 0,30,29,32 0,10,30,32 0,20,28,32 1,30,59,55 0,30,56,43 1,30,77,43 1,20,97,18 0,20,23,32 0,30,25,37 0,30,23,32 0,30,88,43 0,30,49,44 1,30,76,44 1,20,67,25 1,10,55,55 0,20,26,37 1,20,49,44 1,20,68,25 0,30,45,32 1,20,68,43 0,20,32,35 1,30,22,55 1,30,55,55 1,20,66,43 0,20,29,32 1,10,49,44 1,10,28,32 1,10,23,37 0,20,45,32 0,30,22,37 1,10,66,25 0,20,30,32 0,20,43,27 0,20,34,55 0,30,32,32 1,10,67,25 0,20,25,27 1,20,49,38 0,30,33,55 0,20,30,32 1,10,34,37 0,30,33,32 0,10,32,27 0,20,30,32 1,20,66,25 0,30,29,32 1,10,25,37 1,20,55,55 0,30,22,32 1,10,28,38 0,20,22,44 0,30,28,32 0,10,45,32 1,20,65,22 1,10,78,21 1,30,66,25 1,20,99,25 0,10,21,44 0,20,23,37 0,30,22,37 1,30,88,43 0,30,28,32 1,30,49,55 1,10,55,55 0,20,29,32 0,30,87,43 1,30,66,25 1,20,77,22 1,10,26,37 0,30,45,32 0,20,43,22 1,30,64,33 0,20,45,32 0,10,30,32 0,30,56,43 0,20,30,32 0,30,30,32 1,10,78,25 1,20,77,43 1,20,49,38 0,30,32,35 0,10,29,32 1,20,89,22 0,30,30,32 1,30,55,55 0,20,22,32 0,20,32,32 0,30,30,32 0,30,49,44 1,10,77,43 1,20,59,55 0,20,30,32 0,30,22,27 1,20,68,25 1,10,59,55 1,30,17,23 0,20,22,32 1,10,44,43 1,20,76,21 0,20,29,32 1,10,59,55 0,20,29,32 0,30,23,30 1,20,49,44 0,20,33,32 0,20,23,32 1,10,64,33 1,10,49,44 1,30,57,25 1,10,28,32 0,10,22,32 0,30,22,44 0,20,33,23 0,30,46,43 0,30,22,32 1,20,59,55 0,10,22,32 1,20,59,55 1,10,33,24 0,10,55,44 0,30,49,38 1,30,77,25 0,20,22,37 1,30,55,55 1,30,22,25 1,10,44,37 0,30,21,37 1,20,49,44 1,20,55,55 0,30,33,32 0,10,30,32 0,10,29,32 0,30,49,38 1,10,21,37 1,10,55,25 0,30,22,32 0,20,28,32 0,10,25,27 1,20,98,43 1,20,43,37 0,30,49,38 1,20,76,43 0,10,30,32 0,30,32,27 1,10,59,55 0,20,21,27 0,30,55,44 1,20,77,24 0,30,34,37 1,10,59,55 1,10,65,25 1,10,78,65 0,20,19,46 1,10,65,22 1,20,59,55 1,30,55,27 0,20,29,32 1,20,49,38 0,20,23,38 1,20,34,37 0,30,30,32 1,30,59,55 1,10,22,25 1,10,55,23 0,30,29,32 0,20,22,32 0,20,33,27 1,10,56,43 1,10,49,44 1,10,68,25 0,10,22,32 0,20,33,32 0,20,22,27 0,30,28,32 0,20,45,32 0,30,28,38 0,30,24,27 0,20,30,32 0,20,29,32 0,10,24,32 1,10,28,32 1,10,55,55 0,20,20,47 0,20,30,32 0,30,28,32 0,10,30,32 0,20,22,37 0,30,20,47 0,30,45,32 0,10,30,32 0,20,22,27 1,10,33,25 0,10,30,32 0,10,21,55 0,10,45,32 1,30,68,25 0,10,30,32 1,30,65,22 0,30,49,44 1,30,44,25 0,20,28,32 1,10,49,32 1,10,66,43 0,30,45,32 1,10,65,25 1,20,55,23 1,30,78,21 1,10,66,22 0,20,25,37 0,10,43,22 1,10,66,43 0,30,21,55 0,20,23,27 0,30,29,32 1,20,56,43 0,30,24,27 1,10,55,44 1,20,59,55 0,10,34,25 0,20,34,23 1,20,66,25 0,30,34,25 0,20,32,32 0,10,33,27 1,10,88,23 0,30,29,32 0,30,22,27 1,20,17,23 1,10,54,25 1,20,77,25 1,10,59,55 0,10,33,32 0,20,32,37 0,10,22,37 1,20,55,37 1,30,59,55 0,10,29,32 1,10,32,32 1,20,28,38 1,10,66,25 0,10,45,32 1,20,55,55 0,10,19,46 0,30,21,44 1,20,49,44 0,10,33,32 0,20,30,32 1,30,89,22 0,30,30,32 0,20,34,25 1,30,55,55 0,30,30,32 0,20,55,44 0,20,30,32 1,30,59,55 0,30,34,55 0,10,33,23 0,10,30,32 0,10,45,32 0,10,29,32 0,30,78,43 0,30,30,32 0,30,22,37 1,20,49,44 1,20,49,38 1,30,33,24 1,20,57,25 1,10,17,23 1,10,55,55 1,10,76,21 0,10,29,32 0,10,23,32 0,20,33,55 0,30,29,32 0,20,29,32 0,10,29,32 0,20,28,32 1,20,55,25 0,10,22,32 0,30,32,32 1,20,78,43 1,10,87,43 1,10,49,44 0,10,43,27 0,30,26,37 0,20,29,32 0,20,30,32 0,10,22,66 1,30,66,25 0,10,30,32 1,10,88,43 0,20,33,34 1,10,99,25 1,20,55,55 1,10,34,33 0,30,28,32 0,10,29,32 0,30,29,32 0,30,49,38 0,30,33,44 0,10,33,32 1,10,59,55 1,20,55,44 1,20,66,43 1,10,67,25 0,10,30,32 0,30,21,37 0,30,30,32 0,20,22,37 0,20,30,32 0,30,45,32 0,30,28,38 1,20,65,25 0,30,30,32 1,10,76,44 1,10,49,44 1,30,34,33 0,30,22,27 0,10,33,44 0,10,30,32 1,30,55,44 1,20,77,25 0,10,21,27 1,10,76,43 0,20,22,45 0,30,29,32 0,20,21,37 0,30,33,37 0,20,43,24 1,10,59,55 1,10,55,37 1,20,49,44 1,30,88,23 0,20,25,37 0,30,55,37 0,10,34,55 0,20,28,32 0,30,30,32 0,30,28,32 0,10,45,32 1,10,59,55 0,30,29,32 0,20,24,32 0,10,30,32 1,10,77,25 1,20,87,43 0,10,23,38 1,10,28,38 1,30,98,43 0,20,33,32 1,10,59,55 0,20,45,32 1,20,67,25 0,10,21,46 0,20,22,32 1,20,28,38 1,10,21,37 1,30,44,22 0,10,33,27 0,20,28,32 0,30,29,32 1,20,78,65 0,20,24,27 0,30,67,43 1,30,97,18 0,30,28,32 0,10,30,32 0,30,24,55 0,20,33,37 0,30,33,32 1,20,33,24 1,30,55,25 0,10,33,34 1,10,55,55 0,10,24,37 0,10,30,32 0,10,22,37 0,30,22,45 0,30,30,32 1,30,55,55 1,30,66,25 0,30,29,32 1,10,22,55 0,30,29,32 0,10,30,32 0,30,30,32 0,30,33,23 0,20,31,32 1,30,55,55 0,30,29,32 0,10,32,35 0,30,33,32 0,30,30,32 1,10,49,44 0,30,23,38 1,20,64,33 1,20,78,43 1,10,67,43 1,30,78,65 0,20,33,23 0,30,49,44 1,10,28,32 0,20,28,32 0,20,30,32 0,20,30,32 0,30,22,37 1,10,49,44 1,10,88,43 1,10,32,32 1,20,33,43 1,20,56,26 0,30,44,37 0,20,32,27 0,10,22,37 0,20,33,27 1,10,98,43 0,20,21,37 0,30,30,32 0,30,31,32 0,30,33,23 0,30,30,32 0,20,29,32 0,30,29,32 1,20,49,38 1,30,59,55 1,30,59,55 0,30,43,27 0,30,21,54 0,10,22,44 1,10,56,26 0,30,30,32 0,10,22,27 1,10,68,25 1,10,66,25 1,30,77,25 0,20,28,32 0,30,49,44 0,10,33,32 1,30,33,25 1,10,28,32 0,20,22,27 0,20,33,32 0,20,30,32 1,30,33,43 1,10,33,43 1,20,59,55 0,10,34,23 0,30,49,44 1,10,77,22 1,20,49,44 1,10,56,43 1,20,65,25 0,10,23,27 1,10,78,43 1,30,55,55 0,20,22,66 1,10,59,55 0,10,25,37 1,10,59,55 0,30,33,32 0,10,45,32 0,20,22,32 0,20,28,32 0,10,21,54 1,10,44,22 0,30,43,37 0,20,45,32 0,20,25,27 1,20,49,44 0,30,43,22 0,10,33,55 1,10,55,23 0,10,22,32 0,30,29,32 0,10,30,32 1,20,22,55 0,20,33,44 1,30,55,55 0,10,29,32 1,30,65,25 1,30,99,25 1,30,66,43 0,10,22,32 0,20,29,32 1,30,67,25 1,20,66,25 0,20,22,27 0,30,30,32 0,30,22,32 0,20,29,32 1,10,49,38 0,30,24,32 0,20,21,54 0,10,29,32 0,30,23,27 1,10,28,32 0,30,49,44 1,30,49,32 0,20,29,32 1,20,66,25 0,30,33,34 0,20,29,32 1,10,46,43 0,10,30,32 1,30,65,25 1,20,44,25 1,10,59,55 0,10,24,27 0,10,22,27 0,20,22,37 1,10,77,25 0,20,30,32 0,10,33,32 1,10,55,25 1,30,56,26 0,30,68,43 1,20,55,55 1,30,77,24 0,30,49,44 1,30,59,55 0,10,29,32 0,30,49,38 1,20,49,44 1,20,59,55 0,30,49,44 1,20,55,27 0,30,19,46 0,10,29,32 0,10,29,32 1,30,66,43 1,20,55,55 1,10,55,55 1,10,28,32 0,30,22,32 1,20,59,55 0,30,45,32 1,10,49,38 1,20,28,38 0,10,33,32 1,10,22,37 0,30,33,27 0,30,33,32 1,10,28,38 1,20,59,55 0,30,33,37 1,20,33,25 1,10,55,55 0,30,78,43 1,20,67,43 1,20,49,32 0,10,30,32 1,10,66,25 1,10,49,38 1,20,56,43 1,20,78,25 1,30,55,55 0,30,22,37 1,30,59,55 1,20,55,55 0,30,23,37 1,10,49,44 1,10,49,38 0,10,43,24 0,10,23,32 1,20,49,44 0,30,31,32 0,30,33,27 0,20,22,37 1,30,77,22 1,30,59,55 0,20,22,32 1,30,55,23 0,30,30,32 1,10,49,44 0,20,22,32 1,10,68,43 1,10,49,55 1,20,49,55 0,20,29,32 0,10,24,27 1,20,36,37 0,30,32,37 1,10,57,25 0,10,21,37 1,20,59,55 0,30,22,32 0,10,31,32 0,30,29,32 1,20,55,25 1,10,89,22 0,30,22,66 0,10,22,27 0,30,34,23 0,20,29,32 1,20,34,33 0,10,45,32 0,10,20,47 1,10,33,37 0,20,30,32 0,10,45,32 0,30,28,38 0,20,21,37 1,30,76,21 0,30,29,32 0,30,49,38 0,20,55,36 1,10,55,27 0,10,29,32 0,20,24,27 1,10,28,32 0,30,22,27 0,30,29,32 1,10,97,18 1,30,67,25 1,30,55,55 0,30,25,37 1,10,22,37 0,30,28,32 0,20,33,32 0,30,49,44 1,20,22,25 1,10,77,24 0,10,29,32 0,30,55,36 0,10,32,37 1,20,59,55 0,20,29,32 1,10,28,38 1,20,88,43 0,20,29,32 0,20,23,30 1,30,55,25 1,20,88,43 1,10,49,44 1,30,54,25 1,20,55,55 0,30,28,32 1,20,88,23 0,20,44,37 0,20,21,46 1,10,49,38 1,20,55,23 0,10,29,32 1,10,44,25 0,20,31,32 0,30,29,32 0,30,33,24 0,10,33,23 0,10,31,32 1,30,59,55 0,10,22,27 0,10,22,32 1,20,55,55 1,10,43,37 0,30,22,32 0,10,25,27 0,20,31,32 0,20,29,32 1,20,44,43 0,20,45,32 0,10,29,32 1,30,55,23 0,20,30,32 0,30,30,32 1,10,49,44 0,20,30,32 0,30,25,27 0,10,29,32 0,20,33,24 1,20,55,55 0,30,44,43 0,10,29,32 1,10,36,37 0,30,21,27 1,20,66,43 0,30,49,44 0,30,36,37 0,30,30,32 1,20,88,23 1,20,49,38 0,30,45,32 1,20,46,43 0,20,21,44 1,20,66,22 0,30,23,32 1,20,59,55 0,10,22,45 0,20,30,32 0,10,33,24 0,10,29,32 0,30,29,32 0,10,31,32 1,10,78,43 0,20,33,37 1,20,78,21 1,10,88,23 1,20,59,55 1,30,59,55 0,30,43,24 1,30,78,25 1,30,88,23 1,30,66,22 1,20,54,25 0,20,45,32 1,20,49,44 0,20,24,55 1,10,66,43 1,20,44,22 1,10,55,55 1,30,59,55 0,20,30,32 0,10,22,32 1,20,49,44 0,30,66,43 1,30,68,25 1,30,59,55 0,20,28,38 1,10,59,55 0,20,29,32 1,10,55,55 0,30,25,27 0,10,29,32 0,10,55,36 0,30,21,37 0,30,28,38