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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

l = A("l")
c = B("c")
i = C("i")
n = D("n")
j = D("j")
g = A("g")
a = C("a")

l.t = i
l.o = n
l.p = c
c.x = l
c.t = j
c.o = n
i.u = l
i.t = n
n.x = j
n.s = j
n.o = g
n.v = c
j.x = n
j.s = n
j.o = g
j.v = c
g.t = a
g.o = n
g.p = c
a.u = g
a.t = j
assert j.x.v.o.o.t.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

l = A("l")
c = B("c")
i = C("i")
n = D("n")
j = D("j")
g = A("g")
a = C("a")

l.t = i
l.o = n
l.p = c
c.x = l
c.t = j
c.o = n
i.u = l
i.t = n
n.x = j
n.s = j
n.o = g
n.v = c
j.x = n
j.s = n
j.o = g
j.v = c
g.t = a
g.o = n
g.p = c
a.u = g
a.t = j
assert j.x.v.o.o.t.t.o.txt == "g"