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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

j = A("j")
e = B("e")
a = C("a")
n = D("n")
l = E("l")
h = A("h")
g = D("g")
d = E("d")
b = C("b")
c = A("c")

j.u = h
e.w = a
e.y = b
e.s = d
a.p = e
a.y = d
n.o = d
n.x = d
n.z = c
n.y = g
l.y = d
h.u = c
g.o = l
g.x = l
g.z = h
g.y = n
d.y = l
b.p = e
b.y = l
c.u = j
assert h.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

j = A("j")
e = B("e")
a = C("a")
n = D("n")
l = E("l")
h = A("h")
g = D("g")
d = E("d")
b = C("b")
c = A("c")

j.u = h
e.w = a
e.y = b
e.s = d
a.p = e
a.y = d
n.o = d
n.x = d
n.z = c
n.y = g
l.y = d
h.u = c
g.o = l
g.x = l
g.z = h
g.y = n
d.y = l
b.p = e
b.y = l
c.u = j
assert h.u.u.u.u.u.u.u.txt == "c"