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

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

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

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

b = A("b")
i = B("i")
m = C("m")
j = D("j")
k = A("k")
c = B("c")
f = C("f")
l = A("l")

b.r = i
b.z = i
b.t = m
i.u = j
i.v = j
m.t = l
m.s = i
m.u = f
j.z = k
j.u = l
k.r = c
k.z = c
k.t = f
c.u = j
c.v = j
f.t = b
f.s = i
f.u = m
l.r = c
l.z = c
l.t = f
assert j.u.t.s.v.z.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

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

b = A("b")
i = B("i")
m = C("m")
j = D("j")
k = A("k")
c = B("c")
f = C("f")
l = A("l")

b.r = i
b.z = i
b.t = m
i.u = j
i.v = j
m.t = l
m.s = i
m.u = f
j.z = k
j.u = l
k.r = c
k.z = c
k.t = f
c.u = j
c.v = j
f.t = b
f.s = i
f.u = m
l.r = c
l.z = c
l.t = f
assert j.u.t.s.v.z.z.v.txt == "j"