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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.r: A = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: C = None
        self.r: A = None
        self.y: B = None
        self.s: E = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.r: A = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: C = None
        self.r: A = None
        self.y: B = None
        self.s: E = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

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