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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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