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

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

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

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

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

g = A("g")
d = B("d")
i = C("i")
l = D("l")
a = E("a")
c = B("c")
f = E("f")
k = C("k")

g.x = l
g.u = l
g.p = d
g.t = k
g.w = a
d.o = f
d.z = l
d.y = l
i.v = a
l.s = c
a.u = g
a.x = g
a.z = f
a.o = i
c.o = a
c.z = l
c.y = l
f.u = g
f.x = g
f.z = a
f.o = k
k.v = a
assert a.o.v.z.o.v.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: B = None
        self.t: C = None
        self.w: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

g = A("g")
d = B("d")
i = C("i")
l = D("l")
a = E("a")
c = B("c")
f = E("f")
k = C("k")

g.x = l
g.u = l
g.p = d
g.t = k
g.w = a
d.o = f
d.z = l
d.y = l
i.v = a
l.s = c
a.u = g
a.x = g
a.z = f
a.o = i
c.o = a
c.z = l
c.y = l
f.u = g
f.x = g
f.z = a
f.o = k
k.v = a
assert a.o.v.z.o.v.o.v.o.txt == "i"