class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.z: F = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: F = None
        self.s: G = None
        self.q: B = None
        self.w: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: B = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: B = None
        self.o: A = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.s: G = None
        self.x: E = None
        self.txt = txt

k = A("k")
e = B("e")
n = C("n")
i = D("i")
m = E("m")
f = F("f")
b = G("b")
l = E("l")
a = G("a")
g = D("g")

k.p = n
k.x = i
k.z = f
k.w = a
e.r = k
n.y = k
n.u = f
n.s = b
n.q = e
n.w = l
n.t = a
i.q = a
i.y = e
i.t = n
i.v = n
m.p = b
m.u = e
m.s = e
m.o = k
m.y = n
f.o = m
b.r = n
b.w = i
b.s = a
b.x = m
l.p = a
l.u = e
l.s = e
l.o = k
l.y = n
a.r = n
a.w = i
a.s = b
a.x = m
g.q = a
g.y = e
g.t = n
g.v = n
assert k.x.y.r.w.r.t.r.u.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.z: F = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: F = None
        self.s: G = None
        self.q: B = None
        self.w: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: B = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: B = None
        self.o: A = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.s: G = None
        self.x: E = None
        self.txt = txt

k = A("k")
e = B("e")
n = C("n")
i = D("i")
m = E("m")
f = F("f")
b = G("b")
l = E("l")
a = G("a")
g = D("g")

k.p = n
k.x = i
k.z = f
k.w = a
e.r = k
n.y = k
n.u = f
n.s = b
n.q = e
n.w = l
n.t = a
i.q = a
i.y = e
i.t = n
i.v = n
m.p = b
m.u = e
m.s = e
m.o = k
m.y = n
f.o = m
b.r = n
b.w = i
b.s = a
b.x = m
l.p = a
l.u = e
l.s = e
l.o = k
l.y = n
a.r = n
a.w = i
a.s = b
a.x = m
g.q = a
g.y = e
g.t = n
g.v = n
assert k.x.y.r.w.r.t.r.u.o.o.txt == "k"