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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.q: D = None
        self.x: G = None
        self.u: A = None
        self.o: D = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: G = None
        self.x: B = None
        self.y: B = None
        self.u: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: E = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

n = A("n")
m = B("m")
f = C("f")
g = D("g")
j = E("j")
a = F("a")
h = G("h")
c = B("c")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.q: D = None
        self.x: G = None
        self.u: A = None
        self.o: D = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: G = None
        self.x: B = None
        self.y: B = None
        self.u: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: E = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

n = A("n")
m = B("m")
f = C("f")
g = D("g")
j = E("j")
a = F("a")
h = G("h")
c = B("c")

n.v = g
n.t = g
n.u = g
n.p = g
n.q = m
m.r = h
f.z = h
f.u = h
f.o = h
g.r = a
j.r = n
j.u = n
j.w = g
j.q = g
j.o = g
j.x = h
j.p = h
a.v = j
a.r = h
a.x = m
a.y = m
a.u = c
a.p = c
h.y = f
h.o = f
h.p = j
h.w = a
c.r = h
assert m.r.p.o.r.v.x.o.u.txt == "h"