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

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

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

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

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

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

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

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

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

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

l.v = a
l.o = a
l.u = e
l.t = j
e.s = g
e.t = b
n.x = g
n.r = c
c.x = b
c.o = a
c.u = e
a.x = g
a.r = c
b.x = c
b.o = n
b.u = e
j.x = c
j.o = a
j.u = e
g.v = n
g.o = n
g.u = e
g.t = b
assert n.r.x.o.x.txt == "g"