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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: F = None
        self.o: D = None
        self.t: F = None
        self.q: B = None
        self.z: H = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: F = None
        self.o: D = None
        self.t: F = None
        self.q: B = None
        self.z: H = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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