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

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

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

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

g = A("g")
a = B("a")
e = C("e")
i = D("i")
l = D("l")
m = C("m")
j = D("j")

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

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

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

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

g = A("g")
a = B("a")
e = C("e")
i = D("i")
l = D("l")
m = C("m")
j = D("j")

g.z = e
g.w = l
a.p = g
a.u = g
a.s = e
e.r = m
e.u = m
e.v = m
e.o = g
i.y = j
i.t = j
l.y = i
l.t = j
m.r = e
m.u = e
m.v = e
m.o = g
j.y = l
j.t = i
assert j.y.y.y.y.txt == "l"