class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: D = None
        self.y: E = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

a.s = k
a.y = k
a.w = d
a.t = i
a.q = i
f.z = i
f.o = e
e.z = i
e.p = n
l.x = f
k.w = a
d.x = f
i.s = k
i.y = k
i.w = h
i.t = a
i.q = a
n.z = i
n.p = e
h.x = f
g.x = f
assert d.x.o.p.z.y.w.t.q.txt == "a"