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

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

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

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

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

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

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

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

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

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

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

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

k.s = i
k.y = c
k.q = a
a.s = g
a.v = f
a.u = f
f.t = g
e.p = c
e.y = a
e.q = a
c.o = f
c.z = f
c.s = a
c.x = a
h.p = c
h.y = a
h.q = a
g.s = k
g.y = c
g.q = a
d.s = g
d.y = c
d.q = a
i.s = k
i.y = c
i.q = a
assert g.q.v.t.y.s.u.txt == "f"