class A:
    def __init__(self, txt: str):
        self.q: B = 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.w: D = None
        self.t: H = None
        self.p: H = None
        self.v: F = None
        self.u: H = None
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.z: F = None
        self.o: A = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: C = None
        self.v: G = None
        self.q: H = None
        self.z: D = None
        self.w: H = None
        self.txt = txt

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

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

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

e.q = d
e.o = l
d.v = m
b.w = c
b.t = g
b.p = g
b.u = g
b.v = h
b.q = l
b.y = e
c.v = h
c.x = h
c.u = h
c.t = d
c.r = d
c.s = a
c.w = g
m.x = h
m.z = h
m.t = b
m.o = e
m.y = l
h.p = l
h.v = l
h.s = b
h.q = g
h.w = g
h.z = c
l.q = d
l.x = a
l.z = g
g.v = m
g.x = c
g.u = h
a.v = m
assert g.v.o.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = 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.w: D = None
        self.t: H = None
        self.p: H = None
        self.v: F = None
        self.u: H = None
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.z: F = None
        self.o: A = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: C = None
        self.v: G = None
        self.q: H = None
        self.z: D = None
        self.w: H = None
        self.txt = txt

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

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

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

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