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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.z: C = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.z: C = None
        self.x: C = None
        self.txt = txt

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

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