class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: D = None
        self.q: H = None
        self.r: D = None
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: A = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.u: C = None
        self.q: B = None
        self.x: C = None
        self.p: G = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.r: G = None
        self.s: B = None
        self.z: B = None
        self.u: G = None
        self.txt = txt

a = A("a")
n = B("n")
l = C("l")
i = D("i")
b = E("b")
c = F("c")
m = G("m")
f = H("f")
g = G("g")

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: A = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.u: C = None
        self.q: B = None
        self.x: C = None
        self.p: G = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.r: G = None
        self.s: B = None
        self.z: B = None
        self.u: G = None
        self.txt = txt

a = A("a")
n = B("n")
l = C("l")
i = D("i")
b = E("b")
c = F("c")
m = G("m")
f = H("f")
g = G("g")

a.v = n
a.w = i
a.r = i
a.x = i
a.q = f
a.s = c
n.s = g
n.y = i
n.p = l
l.y = f
l.v = f
l.o = a
l.r = m
i.y = l
i.u = l
i.x = l
i.r = a
i.q = n
i.p = g
i.s = b
i.o = f
b.v = i
b.o = l
b.s = c
c.s = i
c.p = i
c.y = i
c.t = n
m.r = b
m.p = n
m.u = l
f.q = b
f.v = m
f.r = m
f.s = n
f.z = n
f.u = g
g.r = b
g.p = n
g.u = l
assert g.r.s.p.s.s.s.p.r.txt == "b"