class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: E = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.u: A = None
        self.p: D = None
        self.r: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.y: D = None
        self.t: E = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: F = None
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.u: A = None
        self.p: D = None
        self.r: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.y: D = None
        self.t: E = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: F = None
        self.s: C = None
        self.txt = txt

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

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

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