class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.u: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.u: B = None
        self.s: D = None
        self.txt = txt

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

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

k.t = c
k.p = c
k.u = a
c.o = k
c.v = l
e.p = l
e.u = j
e.z = b
f.u = i
f.x = c
f.t = l
f.v = l
j.p = c
j.u = c
j.q = b
j.s = b
l.o = f
l.v = j
l.r = n
n.p = c
n.u = c
n.q = f
n.s = b
i.p = l
i.u = j
i.z = b
a.t = c
a.p = c
a.u = k
b.u = i
b.x = c
b.t = l
b.v = l
assert b.t.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.u: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.u: B = None
        self.s: D = None
        self.txt = txt

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

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

k.t = c
k.p = c
k.u = a
c.o = k
c.v = l
e.p = l
e.u = j
e.z = b
f.u = i
f.x = c
f.t = l
f.v = l
j.p = c
j.u = c
j.q = b
j.s = b
l.o = f
l.v = j
l.r = n
n.p = c
n.u = c
n.q = f
n.s = b
i.p = l
i.u = j
i.z = b
a.t = c
a.p = c
a.u = k
b.u = i
b.x = c
b.t = l
b.v = l
assert b.t.o.x.o.txt == "k"