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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.q: A = None
        self.v: G = None
        self.u: G = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.z: B = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: D = None
        self.r: A = None
        self.z: B = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.t: B = None
        self.p: E = None
        self.txt = txt

m = A("m")
g = B("g")
d = C("d")
k = D("k")
h = E("h")
f = F("f")
a = G("a")
i = E("i")
n = D("n")
e = E("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.q: A = None
        self.v: G = None
        self.u: G = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.z: B = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: D = None
        self.r: A = None
        self.z: B = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.t: B = None
        self.p: E = None
        self.txt = txt

m = A("m")
g = B("g")
d = C("d")
k = D("k")
h = E("h")
f = F("f")
a = G("a")
i = E("i")
n = D("n")
e = E("e")

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