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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.q: B = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.q: B = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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