import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
=new Scanner
(System.
in); long n,k;
n=in.nextLong();
k=in.nextLong();
long findMax;
if(n>0&& k>=0)
{
for(int iter=0;iter<n;iter++)
{
arr[iter]=in.nextLong();
}
if(k==0)
{
for(int iter=0;iter<n;iter++)
{
System.
out.
print(arr
[iter
]+" "); }
}
if(k%2==1)
{k=1;}
else
{k=2;}
while(k-->0)
{
for(int iter=0;iter<n;iter++)
{
arr[iter]=findMax-arr[iter];
}
}
}
for(int iter=0;iter<n;iter++)
{
System.
out.
print(arr
[iter
]+" "); }
}
}
CmltcG9ydCBqYXZhLnV0aWwuKjsKaW1wb3J0IGphdmEubGFuZy4qOwppbXBvcnQgamF2YS5pby4qOwoKY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW49bmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgIGxvbmcgIG4sazsKICAgICAgICAKICAgICAgICBuPWluLm5leHRMb25nKCk7CiAJaz1pbi5uZXh0TG9uZygpOwogICAgICAgIAogICAgICAgTG9uZyBhcnJbXT1uZXcgTG9uZ1soaW50KW5dOwogICAgICAgCiAgICAgICBsb25nIGZpbmRNYXg7ICAgICAgCiAJCWlmKG4+MCYmIGs+PTApCiAgICAgICAgewogICAgICAgZm9yKGludCBpdGVyPTA7aXRlcjxuO2l0ZXIrKykKICAgICAgewogICAgICAgICAgYXJyW2l0ZXJdPWluLm5leHRMb25nKCk7CiAgICAgCiAgICAgICAgfQogICAgICAgIAogICAgICAgIGlmKGs9PTApCiAgICAgICAgewogICAgICAgZm9yKGludCBpdGVyPTA7aXRlcjxuO2l0ZXIrKykKICAgICAgICAgIHsgCiAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoYXJyW2l0ZXJdKyIgICIpOwogICAgICAgICAgIH0gIAogCiAgICAgICAgICAgfQogICAgICAgIAogICAgICAgIGlmKGslMj09MSkKICAgICAgICB7az0xO30KICAgICAgICBlbHNlCiAgICAgICAge2s9Mjt9CiAgICAgICAgCiAgICAgIHdoaWxlKGstLT4wKQogICAgIHsKICAgICAgICBMaXN0IDxMb25nPiBsaXN0PSBBcnJheXMuYXNMaXN0KGFycik7CiAgICAgCSBmaW5kTWF4PShsb25nKUNvbGxlY3Rpb25zLm1heChsaXN0KTsKICAgICAJCiAgICAgCSBmb3IoaW50IGl0ZXI9MDtpdGVyPG47aXRlcisrKQogICAgICAgewogICAgICAgICAgIGFycltpdGVyXT1maW5kTWF4LWFycltpdGVyXTsKCiAgICAgICAgfSAgICAKICAgICAKICAgICB9CiAgICAgfQogICAgICAgZm9yKGludCBpdGVyPTA7aXRlcjxuO2l0ZXIrKykKICAgICAgICAgIHsgCiAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoYXJyW2l0ZXJdKyIgICIpOwogICAgICAgICAgICAgICAgIH0gIAoJCn0KfQ==