class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.t: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.x: A = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.txt = txt

k = A("k")
e = B("e")
d = C("d")
n = D("n")
c = E("c")
j = F("j")
a = F("a")
h = E("h")
b = C("b")
f = A("f")

k.q = f
k.o = c
k.t = n
k.u = h
k.z = j
e.w = j
e.u = j
e.o = n
e.v = n
e.x = k
d.q = e
n.y = e
c.p = h
c.y = f
j.t = b
j.z = n
a.t = d
a.z = n
h.p = c
h.y = k
b.q = e
f.q = k
f.o = c
f.t = n
f.u = h
f.z = j
assert b.q.x.o.y.o.p.y.o.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.t: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.x: A = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.txt = txt

k = A("k")
e = B("e")
d = C("d")
n = D("n")
c = E("c")
j = F("j")
a = F("a")
h = E("h")
b = C("b")
f = A("f")

k.q = f
k.o = c
k.t = n
k.u = h
k.z = j
e.w = j
e.u = j
e.o = n
e.v = n
e.x = k
d.q = e
n.y = e
c.p = h
c.y = f
j.t = b
j.z = n
a.t = d
a.z = n
h.p = c
h.y = k
b.q = e
f.q = k
f.o = c
f.t = n
f.u = h
f.z = j
assert b.q.x.o.y.o.p.y.o.p.y.txt == "k"