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

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

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

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

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

k = A("k")
g = B("g")
j = C("j")
m = D("m")
f = E("f")
d = B("d")
e = D("e")
i = C("i")

k.t = f
g.o = e
g.p = d
g.u = d
g.x = f
g.q = k
j.o = k
j.v = k
j.x = d
j.r = f
m.u = f
m.o = f
m.s = f
m.w = g
f.o = k
f.x = k
f.v = m
f.t = m
d.o = m
d.p = g
d.u = g
d.x = f
d.q = k
e.u = f
e.o = f
e.s = f
e.w = g
i.o = k
i.v = k
i.x = d
i.r = f
assert g.x.o.t.v.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

k = A("k")
g = B("g")
j = C("j")
m = D("m")
f = E("f")
d = B("d")
e = D("e")
i = C("i")

k.t = f
g.o = e
g.p = d
g.u = d
g.x = f
g.q = k
j.o = k
j.v = k
j.x = d
j.r = f
m.u = f
m.o = f
m.s = f
m.w = g
f.o = k
f.x = k
f.v = m
f.t = m
d.o = m
d.p = g
d.u = g
d.x = f
d.q = k
e.u = f
e.o = f
e.s = f
e.w = g
i.o = k
i.v = k
i.x = d
i.r = f
assert g.x.o.t.v.u.o.txt == "k"