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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: E = None
        self.q: A = None
        self.r: D = None
        self.x: B = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
a = C("a")
l = D("l")
g = E("g")
m = F("m")
d = G("d")
k = H("k")
f = D("f")

n.p = a
n.t = f
n.q = g
n.w = g
n.o = d
j.v = g
a.x = j
a.r = j
a.u = g
a.w = d
a.v = m
l.u = a
l.w = d
l.o = f
l.x = f
g.t = n
g.s = n
g.q = n
g.o = l
g.p = j
m.t = d
m.v = g
m.q = n
m.r = l
m.x = j
m.o = j
m.s = a
d.p = n
k.x = n
f.u = a
f.w = d
f.o = l
f.x = l
assert j.v.t.o.p.t.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.q: E = None
        self.w: E = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: E = None
        self.q: A = None
        self.r: D = None
        self.x: B = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
a = C("a")
l = D("l")
g = E("g")
m = F("m")
d = G("d")
k = H("k")
f = D("f")

n.p = a
n.t = f
n.q = g
n.w = g
n.o = d
j.v = g
a.x = j
a.r = j
a.u = g
a.w = d
a.v = m
l.u = a
l.w = d
l.o = f
l.x = f
g.t = n
g.s = n
g.q = n
g.o = l
g.p = j
m.t = d
m.v = g
m.q = n
m.r = l
m.x = j
m.o = j
m.s = a
d.p = n
k.x = n
f.u = a
f.w = d
f.o = l
f.x = l
assert j.v.t.o.p.t.u.v.txt == "m"