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

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

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

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

n = A("n")
h = B("h")
a = C("a")
j = D("j")
g = A("g")
f = B("f")
c = C("c")
b = D("b")
l = C("l")
k = A("k")

n.v = j
n.u = j
n.t = j
h.v = c
h.q = a
a.q = f
a.p = j
j.r = n
g.v = j
g.u = j
g.t = j
f.v = l
f.q = l
c.q = f
c.p = j
b.r = g
l.q = f
l.p = j
k.v = b
k.u = b
k.t = b
assert f.v.p.r.v.r.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

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

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

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

n = A("n")
h = B("h")
a = C("a")
j = D("j")
g = A("g")
f = B("f")
c = C("c")
b = D("b")
l = C("l")
k = A("k")

n.v = j
n.u = j
n.t = j
h.v = c
h.q = a
a.q = f
a.p = j
j.r = n
g.v = j
g.u = j
g.t = j
f.v = l
f.q = l
c.q = f
c.p = j
b.r = g
l.q = f
l.p = j
k.v = b
k.u = b
k.t = b
assert f.v.p.r.v.r.v.r.txt == "n"