class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: G = None
        self.q: C = None
        self.r: H = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.s: C = None
        self.p: C = None
        self.o: H = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

m = A("m")
n = B("n")
g = C("g")
d = D("d")
k = E("k")
c = F("c")
i = G("i")
a = H("a")

m.o = g
m.q = g
m.z = i
m.r = a
m.u = k
m.p = k
n.p = c
n.u = i
n.r = d
g.t = i
g.s = i
g.r = d
g.w = d
g.y = n
g.q = n
g.p = k
d.w = m
d.s = g
k.q = m
k.v = g
k.s = g
k.p = g
k.o = a
k.z = a
c.z = a
c.p = k
c.o = g
i.t = d
i.y = m
i.q = n
a.v = k
a.w = g
a.q = g
a.y = g
a.t = d
assert i.y.u.o.v.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: G = None
        self.q: C = None
        self.r: H = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.s: C = None
        self.p: C = None
        self.o: H = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

m = A("m")
n = B("n")
g = C("g")
d = D("d")
k = E("k")
c = F("c")
i = G("i")
a = H("a")

m.o = g
m.q = g
m.z = i
m.r = a
m.u = k
m.p = k
n.p = c
n.u = i
n.r = d
g.t = i
g.s = i
g.r = d
g.w = d
g.y = n
g.q = n
g.p = k
d.w = m
d.s = g
k.q = m
k.v = g
k.s = g
k.p = g
k.o = a
k.z = a
c.z = a
c.p = k
c.o = g
i.t = d
i.y = m
i.q = n
a.v = k
a.w = g
a.q = g
a.y = g
a.t = d
assert i.y.u.o.v.o.q.txt == "g"