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

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

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

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

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

f = A("f")
l = B("l")
d = C("d")
a = D("a")
i = E("i")
k = B("k")
n = C("n")

f.p = a
f.y = i
l.r = i
l.t = i
l.w = i
l.q = f
l.o = k
d.z = a
d.q = n
a.y = i
a.w = n
a.r = f
i.o = d
i.r = d
i.t = l
k.r = i
k.t = i
k.w = i
k.q = f
k.o = l
n.z = a
n.q = d
assert k.q.y.t.w.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

f = A("f")
l = B("l")
d = C("d")
a = D("a")
i = E("i")
k = B("k")
n = C("n")

f.p = a
f.y = i
l.r = i
l.t = i
l.w = i
l.q = f
l.o = k
d.z = a
d.q = n
a.y = i
a.w = n
a.r = f
i.o = d
i.r = d
i.t = l
k.r = i
k.t = i
k.w = i
k.q = f
k.o = l
n.z = a
n.q = d
assert k.q.y.t.w.o.z.txt == "a"