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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: C = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

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

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

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

i.x = m
i.y = m
e.q = d
e.s = f
e.z = j
e.o = j
k.w = f
k.s = f
k.p = b
n.w = e
n.u = m
n.v = m
c.x = n
c.y = m
j.q = e
j.s = f
j.z = d
j.o = d
b.x = n
b.y = m
d.q = j
d.s = f
d.z = e
d.o = e
f.w = k
f.s = k
f.p = i
m.w = j
m.u = n
m.v = n
assert c.y.w.z.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: C = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

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

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

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

i.x = m
i.y = m
e.q = d
e.s = f
e.z = j
e.o = j
k.w = f
k.s = f
k.p = b
n.w = e
n.u = m
n.v = m
c.x = n
c.y = m
j.q = e
j.s = f
j.z = d
j.o = d
b.x = n
b.y = m
d.q = j
d.s = f
d.z = e
d.o = e
f.w = k
f.s = k
f.p = i
m.w = j
m.u = n
m.v = n
assert c.y.w.z.q.q.q.txt == "d"