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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.o: A = None
        self.z: A = None
        self.txt = txt

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

l.p = c
l.t = m
l.q = g
l.y = d
l.u = j
c.u = m
c.x = j
m.y = f
b.u = h
b.x = h
b.p = m
b.r = c
a.r = j
a.q = h
a.o = g
a.z = d
f.u = c
f.x = h
f.r = h
f.p = m
g.p = h
g.t = m
g.q = l
g.y = d
g.u = j
d.p = c
d.t = m
d.q = l
d.y = g
d.u = a
h.u = m
h.x = a
j.r = a
j.q = c
j.o = g
j.z = l
assert h.u.y.u.u.y.u.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: C = None
        self.q: A = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.o: A = None
        self.z: A = None
        self.txt = txt

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

l.p = c
l.t = m
l.q = g
l.y = d
l.u = j
c.u = m
c.x = j
m.y = f
b.u = h
b.x = h
b.p = m
b.r = c
a.r = j
a.q = h
a.o = g
a.z = d
f.u = c
f.x = h
f.r = h
f.p = m
g.p = h
g.t = m
g.q = l
g.y = d
g.u = j
d.p = c
d.t = m
d.q = l
d.y = g
d.u = a
h.u = m
h.x = a
j.r = a
j.q = c
j.o = g
j.z = l
assert h.u.y.u.u.y.u.u.y.txt == "f"