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

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

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

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

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

j = A("j")
l = B("l")
f = C("f")
i = D("i")
c = E("c")
m = D("m")
k = E("k")
n = B("n")
b = E("b")
h = A("h")

j.s = f
j.u = c
l.t = m
f.y = i
f.o = j
i.u = n
i.q = n
i.s = h
i.w = m
i.o = c
c.u = m
c.r = b
c.w = f
c.s = j
m.u = l
m.q = n
m.s = h
m.w = i
m.o = k
k.u = m
k.r = b
k.w = f
k.s = j
n.t = m
b.u = i
b.r = k
b.w = f
b.s = h
h.s = f
h.u = k
assert c.w.y.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
f = C("f")
i = D("i")
c = E("c")
m = D("m")
k = E("k")
n = B("n")
b = E("b")
h = A("h")

j.s = f
j.u = c
l.t = m
f.y = i
f.o = j
i.u = n
i.q = n
i.s = h
i.w = m
i.o = c
c.u = m
c.r = b
c.w = f
c.s = j
m.u = l
m.q = n
m.s = h
m.w = i
m.o = k
k.u = m
k.r = b
k.w = f
k.s = j
n.t = m
b.u = i
b.r = k
b.w = f
b.s = h
h.s = f
h.u = k
assert c.w.y.w.w.txt == "i"