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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.r: F = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

g = A("g")
e = B("e")
b = C("b")
c = D("c")
j = E("j")
h = F("h")
d = G("d")
a = H("a")
m = F("m")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.r: F = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

g = A("g")
e = B("e")
b = C("b")
c = D("c")
j = E("j")
h = F("h")
d = G("d")
a = H("a")
m = F("m")

g.v = c
g.p = d
e.p = b
e.y = d
e.u = d
e.r = m
e.q = c
b.q = c
c.v = b
c.y = e
c.t = j
c.w = d
c.r = d
c.q = a
c.s = g
j.p = d
h.z = g
h.o = c
h.y = b
d.z = a
a.w = c
a.q = c
a.p = e
a.t = e
a.y = g
a.x = g
a.o = b
a.r = b
m.z = g
m.o = c
m.y = b
assert e.p.q.w.z.y.v.t.p.z.txt == "a"