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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

h = A("h")
k = B("k")
e = C("e")
n = D("n")
c = E("c")
b = F("b")
g = B("g")

h.u = k
k.o = h
k.w = e
k.v = e
k.p = b
k.r = b
e.v = k
e.u = n
n.z = c
n.o = c
n.u = h
n.x = b
n.p = b
c.z = e
c.o = e
c.s = e
c.v = g
b.t = c
b.v = c
b.z = e
b.y = e
g.o = h
g.w = e
g.v = e
g.p = b
g.r = b
assert e.u.u.u.r.t.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

h = A("h")
k = B("k")
e = C("e")
n = D("n")
c = E("c")
b = F("b")
g = B("g")

h.u = k
k.o = h
k.w = e
k.v = e
k.p = b
k.r = b
e.v = k
e.u = n
n.z = c
n.o = c
n.u = h
n.x = b
n.p = b
c.z = e
c.o = e
c.s = e
c.v = g
b.t = c
b.v = c
b.z = e
b.y = e
g.o = h
g.w = e
g.v = e
g.p = b
g.r = b
assert e.u.u.u.r.t.o.v.txt == "k"