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

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

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

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

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

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

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

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

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

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

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