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

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

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

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

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

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

e.y = c
e.q = m
l.v = e
l.r = j
l.o = d
k.s = l
k.z = l
k.t = e
k.r = f
k.x = i
f.r = j
f.q = e
f.s = k
j.w = i
b.v = e
b.r = i
b.o = d
d.s = b
d.z = b
d.t = e
d.r = m
d.x = i
c.r = j
c.q = e
c.s = d
i.w = j
m.r = j
m.q = e
m.s = d
assert j.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

e.y = c
e.q = m
l.v = e
l.r = j
l.o = d
k.s = l
k.z = l
k.t = e
k.r = f
k.x = i
f.r = j
f.q = e
f.s = k
j.w = i
b.v = e
b.r = i
b.o = d
d.s = b
d.z = b
d.t = e
d.r = m
d.x = i
c.r = j
c.q = e
c.s = d
i.w = j
m.r = j
m.q = e
m.s = d
assert j.w.w.w.txt == "i"