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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

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

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

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

f.s = l
f.u = a
n.r = l
n.x = a
g.q = k
g.w = n
g.u = a
g.s = c
a.u = n
a.o = g
a.y = c
a.x = c
a.t = k
k.t = f
k.z = i
i.r = l
i.x = a
c.q = k
c.w = n
c.u = a
c.s = g
h.s = l
h.u = a
l.s = f
l.u = a
assert h.s.s.s.u.o.txt == "g"