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

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

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

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

f = A("f")
l = B("l")
g = C("g")
k = D("k")
n = D("n")
m = C("m")
c = A("c")
a = A("a")
e = A("e")
i = C("i")

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

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

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

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

f = A("f")
l = B("l")
g = C("g")
k = D("k")
n = D("n")
m = C("m")
c = A("c")
a = A("a")
e = A("e")
i = C("i")

f.w = m
f.t = m
f.q = g
l.s = m
l.w = k
g.z = l
g.o = l
g.x = l
g.r = i
k.y = c
k.v = l
k.z = n
n.y = f
n.v = l
n.z = k
m.z = l
m.o = l
m.x = l
m.r = i
c.w = i
c.q = i
c.t = g
a.w = g
a.t = i
a.q = m
e.w = i
e.t = i
e.q = g
i.z = l
i.o = l
i.x = l
i.r = g
assert f.q.r.r.r.txt == "i"