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

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

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

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

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

i.u = j
i.o = j
i.t = f
i.z = b
l.v = e
l.t = b
l.x = j
k.t = j
k.z = b
k.r = f
j.o = b
d.u = j
d.o = j
d.t = k
d.z = i
h.v = e
h.t = d
h.x = j
e.v = h
e.t = d
e.x = c
b.u = j
b.o = j
b.t = k
b.z = d
c.o = i
f.t = j
f.z = b
f.r = k
assert h.t.z.z.u.o.t.r.t.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.z: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

i.u = j
i.o = j
i.t = f
i.z = b
l.v = e
l.t = b
l.x = j
k.t = j
k.z = b
k.r = f
j.o = b
d.u = j
d.o = j
d.t = k
d.z = i
h.v = e
h.t = d
h.x = j
e.v = h
e.t = d
e.x = c
b.u = j
b.o = j
b.t = k
b.z = d
c.o = i
f.t = j
f.z = b
f.r = k
assert h.t.z.z.u.o.t.r.t.o.o.txt == "j"