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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: C = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

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

n = A("n")
j = B("j")
d = C("d")
a = D("a")
h = E("h")
c = F("c")
k = G("k")
m = F("m")
b = D("b")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: C = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

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

n = A("n")
j = B("j")
d = C("d")
a = D("a")
h = E("h")
c = F("c")
k = G("k")
m = F("m")
b = D("b")

n.x = j
n.q = a
n.p = c
n.o = c
n.t = m
n.z = b
j.y = m
j.u = k
j.q = c
d.z = k
d.v = k
d.s = a
d.y = b
a.p = b
a.o = j
h.r = b
h.t = b
h.x = m
h.w = m
c.w = k
c.y = d
c.s = j
c.x = m
k.z = n
k.s = n
k.p = b
k.q = j
k.o = d
k.x = d
m.w = k
m.y = d
m.s = j
m.x = c
b.p = a
b.o = j
assert k.p.o.q.txt == "c"