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

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.v: A = None
        self.r: A = None
        self.txt = txt

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

i = A("i")
l = B("l")
h = C("h")
j = D("j")
d = C("d")
n = B("n")
c = A("c")
f = D("f")

i.o = l
i.y = l
i.t = f
i.w = h
l.q = j
l.w = d
l.u = i
h.q = d
h.y = i
h.v = i
h.r = c
j.v = f
j.t = f
d.q = h
d.y = c
d.v = i
d.r = i
n.q = j
n.w = h
n.u = c
c.o = n
c.t = j
c.y = l
c.w = d
f.v = j
f.t = j
assert c.o.q.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.v: A = None
        self.r: A = None
        self.txt = txt

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

i = A("i")
l = B("l")
h = C("h")
j = D("j")
d = C("d")
n = B("n")
c = A("c")
f = D("f")

i.o = l
i.y = l
i.t = f
i.w = h
l.q = j
l.w = d
l.u = i
h.q = d
h.y = i
h.v = i
h.r = c
j.v = f
j.t = f
d.q = h
d.y = c
d.v = i
d.r = i
n.q = j
n.w = h
n.u = c
c.o = n
c.t = j
c.y = l
c.w = d
f.v = j
f.t = j
assert c.o.q.t.v.txt == "j"