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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

b = A("b")
e = B("e")
g = C("g")
f = D("f")
d = E("d")
i = E("i")
a = D("a")
l = C("l")

b.u = d
b.p = a
b.w = e
e.s = a
e.o = a
e.z = f
e.v = g
g.p = l
g.r = d
f.o = b
f.q = g
f.z = l
f.v = e
d.o = e
d.p = l
i.o = e
i.p = g
a.o = b
a.q = l
a.z = g
a.v = e
l.p = g
l.r = i
assert i.p.p.p.p.p.r.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

b = A("b")
e = B("e")
g = C("g")
f = D("f")
d = E("d")
i = E("i")
a = D("a")
l = C("l")

b.u = d
b.p = a
b.w = e
e.s = a
e.o = a
e.z = f
e.v = g
g.p = l
g.r = d
f.o = b
f.q = g
f.z = l
f.v = e
d.o = e
d.p = l
i.o = e
i.p = g
a.o = b
a.q = l
a.z = g
a.v = e
l.p = g
l.r = i
assert i.p.p.p.p.p.r.p.p.txt == "g"