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

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

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

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

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

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

j.x = l
j.p = i
j.t = a
c.u = j
c.p = f
c.q = g
c.r = b
i.v = j
i.o = j
i.p = j
i.u = g
a.s = l
a.w = l
a.z = c
a.y = b
g.p = a
g.y = f
g.u = l
g.o = l
f.u = j
f.p = e
f.q = g
f.r = b
b.v = j
b.o = j
b.p = j
b.u = g
l.s = a
l.w = a
l.z = e
l.y = i
e.u = j
e.p = c
e.q = g
e.r = b
assert l.w.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

j.x = l
j.p = i
j.t = a
c.u = j
c.p = f
c.q = g
c.r = b
i.v = j
i.o = j
i.p = j
i.u = g
a.s = l
a.w = l
a.z = c
a.y = b
g.p = a
g.y = f
g.u = l
g.o = l
f.u = j
f.p = e
f.q = g
f.r = b
b.v = j
b.o = j
b.p = j
b.u = g
l.s = a
l.w = a
l.z = e
l.y = i
e.u = j
e.p = c
e.q = g
e.r = b
assert l.w.y.u.txt == "g"