class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.p: C = None
        self.y: C = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: E = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

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

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

i = A("i")
k = B("k")
d = C("d")
n = D("n")
g = E("g")
a = F("a")
b = E("b")

i.z = b
i.q = d
i.p = d
i.y = d
i.u = d
i.o = g
k.r = i
k.y = i
k.q = i
k.s = b
d.u = n
d.p = n
d.v = k
n.o = d
n.u = d
n.q = g
n.x = k
g.r = b
g.o = n
a.w = n
b.r = g
b.o = n
assert n.x.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.p: C = None
        self.y: C = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: E = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

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

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

i = A("i")
k = B("k")
d = C("d")
n = D("n")
g = E("g")
a = F("a")
b = E("b")

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