class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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