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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

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

e = A("e")
m = B("m")
n = C("n")
a = D("a")
f = E("f")
c = F("c")
i = B("i")
k = A("k")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

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

e = A("e")
m = B("m")
n = C("n")
a = D("a")
f = E("f")
c = F("c")
i = B("i")
k = A("k")

e.q = a
e.v = k
e.p = n
e.o = i
e.t = i
e.s = m
m.q = n
m.w = c
n.z = a
n.u = a
n.s = e
a.z = f
a.u = f
f.u = k
f.w = k
f.q = m
c.t = m
c.o = m
c.r = a
c.v = n
c.u = k
i.q = n
i.w = c
k.q = a
k.v = e
k.p = n
k.o = m
k.t = m
k.s = i
assert n.s.s.w.r.z.txt == "f"