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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: D = None
        self.y: G = None
        self.v: G = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: B = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

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

k = A("k")
h = B("h")
m = C("m")
b = D("b")
g = E("g")
j = F("j")
i = G("i")
n = E("n")

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: D = None
        self.y: G = None
        self.v: G = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: B = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

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

k = A("k")
h = B("h")
m = C("m")
b = D("b")
g = E("g")
j = F("j")
i = G("i")
n = E("n")

k.o = b
k.q = i
h.u = j
h.z = j
h.q = i
h.p = i
m.w = g
m.z = b
m.y = i
m.v = i
m.x = h
b.u = n
g.z = k
g.q = k
g.o = j
g.v = n
g.p = b
j.p = i
j.q = i
j.v = h
j.r = k
i.z = k
i.v = j
i.w = h
i.o = b
i.y = b
i.s = m
i.p = m
n.z = k
n.q = k
n.o = j
n.v = g
n.p = b
assert m.x.p.p.w.p.txt == "b"