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

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

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

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

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

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

e.o = m
e.r = g
k.t = c
k.x = g
k.s = f
k.w = m
k.u = d
f.y = e
f.x = c
j.w = g
j.o = f
j.u = f
g.o = c
g.x = f
g.y = m
g.t = b
m.t = j
m.x = g
m.s = f
m.w = k
m.u = e
d.o = m
d.r = g
c.w = g
c.o = f
c.u = f
b.w = g
b.o = f
b.u = f
assert g.y.w.x.t.w.y.u.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

e.o = m
e.r = g
k.t = c
k.x = g
k.s = f
k.w = m
k.u = d
f.y = e
f.x = c
j.w = g
j.o = f
j.u = f
g.o = c
g.x = f
g.y = m
g.t = b
m.t = j
m.x = g
m.s = f
m.w = k
m.u = e
d.o = m
d.r = g
c.w = g
c.o = f
c.u = f
b.w = g
b.o = f
b.u = f
assert g.y.w.x.t.w.y.u.o.t.txt == "j"