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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.txt = txt

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

g = A("g")
k = B("k")
h = C("h")
b = D("b")
c = E("c")
m = A("m")
n = E("n")

g.u = k
g.s = m
g.t = m
g.y = b
g.o = c
k.u = h
k.r = h
k.x = b
k.o = m
k.q = c
h.o = b
h.r = k
h.w = k
h.x = g
b.w = g
b.y = h
c.w = g
m.u = k
m.s = g
m.t = g
m.y = b
m.o = c
n.w = g
assert m.u.o.s.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.y: D = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.txt = txt

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

g = A("g")
k = B("k")
h = C("h")
b = D("b")
c = E("c")
m = A("m")
n = E("n")

g.u = k
g.s = m
g.t = m
g.y = b
g.o = c
k.u = h
k.r = h
k.x = b
k.o = m
k.q = c
h.o = b
h.r = k
h.w = k
h.x = g
b.w = g
b.y = h
c.w = g
m.u = k
m.s = g
m.t = g
m.y = b
m.o = c
n.w = g
assert m.u.o.s.s.t.txt == "g"