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

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

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

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

h = A("h")
l = B("l")
f = C("f")
j = D("j")
a = D("a")
i = A("i")
c = B("c")
b = A("b")

h.t = a
l.z = c
l.o = c
l.v = f
l.u = h
f.o = c
f.u = j
f.p = j
f.y = i
j.w = c
j.s = f
a.w = c
a.s = f
i.t = j
c.z = l
c.o = l
c.v = f
c.u = i
b.t = a
assert j.s.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

h = A("h")
l = B("l")
f = C("f")
j = D("j")
a = D("a")
i = A("i")
c = B("c")
b = A("b")

h.t = a
l.z = c
l.o = c
l.v = f
l.u = h
f.o = c
f.u = j
f.p = j
f.y = i
j.w = c
j.s = f
a.w = c
a.s = f
i.t = j
c.z = l
c.o = l
c.v = f
c.u = i
b.t = a
assert j.s.y.t.txt == "j"