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

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

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

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

j = A("j")
a = B("a")
l = C("l")
c = D("c")
k = B("k")
e = C("e")
i = B("i")

j.t = l
j.w = e
j.o = c
a.t = c
a.o = c
a.z = j
l.x = k
l.p = a
l.r = c
c.x = e
c.r = e
c.v = j
c.p = l
k.t = c
k.o = c
k.z = j
e.x = a
e.p = k
e.r = c
i.t = c
i.o = c
i.z = j
assert j.o.v.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
l = C("l")
c = D("c")
k = B("k")
e = C("e")
i = B("i")

j.t = l
j.w = e
j.o = c
a.t = c
a.o = c
a.z = j
l.x = k
l.p = a
l.r = c
c.x = e
c.r = e
c.v = j
c.p = l
k.t = c
k.o = c
k.z = j
e.x = a
e.p = k
e.r = c
i.t = c
i.o = c
i.z = j
assert j.o.v.t.p.o.txt == "c"