class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

k.t = i
f.o = k
i.x = e
i.u = c
b.y = i
b.v = i
b.u = k
b.p = k
b.x = a
b.o = n
m.p = k
m.v = k
m.o = i
e.r = f
e.u = d
e.w = b
e.x = b
a.o = k
c.p = k
c.v = k
c.o = i
d.r = a
d.u = e
d.w = n
d.x = b
n.y = i
n.v = i
n.u = k
n.p = k
n.x = f
n.o = b
assert k.t.u.p.t.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

k.t = i
f.o = k
i.x = e
i.u = c
b.y = i
b.v = i
b.u = k
b.p = k
b.x = a
b.o = n
m.p = k
m.v = k
m.o = i
e.r = f
e.u = d
e.w = b
e.x = b
a.o = k
c.p = k
c.v = k
c.o = i
d.r = a
d.u = e
d.w = n
d.x = b
n.y = i
n.v = i
n.u = k
n.p = k
n.x = f
n.o = b
assert k.t.u.p.t.u.o.u.txt == "c"