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

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

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

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

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

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

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

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

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

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

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

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

f.z = j
f.p = j
f.s = k
l.q = k
k.t = n
k.o = l
n.q = d
n.z = d
n.v = j
n.x = k
j.y = l
j.o = f
g.q = n
g.z = d
g.v = j
g.x = k
d.q = i
d.z = g
d.v = j
d.x = k
i.q = d
i.z = n
i.v = j
i.x = k
assert l.q.o.q.o.q.o.q.txt == "k"