class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

i = A("i")
g = B("g")
m = C("m")
d = D("d")
n = B("n")
e = B("e")
c = D("c")
j = C("j")
k = B("k")

i.w = j
i.z = j
i.u = g
g.r = i
g.u = e
g.q = k
g.o = c
m.y = k
m.t = j
d.q = c
d.y = j
d.w = i
n.r = i
n.u = e
n.q = k
n.o = c
e.r = i
e.u = g
e.q = g
e.o = c
c.q = d
c.y = m
c.w = i
j.y = n
j.t = m
k.r = i
k.u = g
k.q = g
k.o = c
assert n.u.o.y.y.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

i = A("i")
g = B("g")
m = C("m")
d = D("d")
n = B("n")
e = B("e")
c = D("c")
j = C("j")
k = B("k")

i.w = j
i.z = j
i.u = g
g.r = i
g.u = e
g.q = k
g.o = c
m.y = k
m.t = j
d.q = c
d.y = j
d.w = i
n.r = i
n.u = e
n.q = k
n.o = c
e.r = i
e.u = g
e.q = g
e.o = c
c.q = d
c.y = m
c.w = i
j.y = n
j.t = m
k.r = i
k.u = g
k.q = g
k.o = c
assert n.u.o.y.y.u.u.txt == "e"