class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.z: D = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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