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

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

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

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

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

i.r = g
i.z = g
i.y = l
i.o = f
l.q = d
l.o = e
l.w = k
l.t = c
c.t = i
c.p = l
g.t = m
g.r = f
e.q = g
e.o = l
e.w = k
e.t = k
m.t = d
m.r = i
d.t = g
d.r = f
k.t = i
k.p = e
f.r = d
f.z = g
f.y = e
f.o = i
assert i.y.q.t.r.z.t.t.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.y: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

i.r = g
i.z = g
i.y = l
i.o = f
l.q = d
l.o = e
l.w = k
l.t = c
c.t = i
c.p = l
g.t = m
g.r = f
e.q = g
e.o = l
e.w = k
e.t = k
m.t = d
m.r = i
d.t = g
d.r = f
k.t = i
k.p = e
f.r = d
f.z = g
f.y = e
f.o = i
assert i.y.q.t.r.z.t.t.r.y.txt == "e"