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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

i = A("i")
m = B("m")
l = C("l")
j = D("j")
g = A("g")
e = B("e")
h = C("h")
c = A("c")
n = C("n")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

i = A("i")
m = B("m")
l = C("l")
j = D("j")
g = A("g")
e = B("e")
h = C("h")
c = A("c")
n = C("n")

i.x = l
i.y = e
i.r = g
m.t = j
m.w = h
m.y = e
m.z = e
l.q = g
l.v = c
l.x = j
l.u = n
j.w = e
j.v = h
g.x = h
g.y = m
g.r = c
e.t = j
e.w = l
e.y = m
e.z = m
h.q = c
h.v = i
h.x = j
h.u = l
c.x = h
c.y = m
c.r = g
n.q = i
n.v = c
n.x = j
n.u = l
assert g.y.t.w.y.z.y.y.txt == "e"