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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.p: E = None
        self.s: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.p: E = None
        self.s: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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