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

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

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

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

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

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

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

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

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