class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

e = A("e")
i = B("i")
n = C("n")
k = D("k")
j = E("j")
g = E("g")
h = A("h")
b = B("b")

e.o = k
e.t = k
e.x = h
e.s = h
i.y = b
i.q = n
n.t = i
n.y = g
k.z = i
k.u = i
j.x = i
j.o = n
g.x = b
g.o = n
h.o = k
h.t = k
h.x = e
h.s = e
b.y = i
b.q = n
assert h.s.t.u.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

e = A("e")
i = B("i")
n = C("n")
k = D("k")
j = E("j")
g = E("g")
h = A("h")
b = B("b")

e.o = k
e.t = k
e.x = h
e.s = h
i.y = b
i.q = n
n.t = i
n.y = g
k.z = i
k.u = i
j.x = i
j.o = n
g.x = b
g.o = n
h.o = k
h.t = k
h.x = e
h.s = e
b.y = i
b.q = n
assert h.s.t.u.q.t.txt == "i"