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

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

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

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

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

j = A("j")
h = B("h")
e = C("e")
b = D("b")
n = E("n")
g = C("g")
l = D("l")
m = B("m")

j.w = h
j.y = m
j.o = l
h.q = j
h.u = j
h.s = m
e.x = b
e.q = l
b.q = e
b.u = j
n.z = m
g.x = l
g.q = b
l.q = e
l.u = j
m.q = j
m.u = j
m.s = h
assert m.q.o.u.w.s.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

j = A("j")
h = B("h")
e = C("e")
b = D("b")
n = E("n")
g = C("g")
l = D("l")
m = B("m")

j.w = h
j.y = m
j.o = l
h.q = j
h.u = j
h.s = m
e.x = b
e.q = l
b.q = e
b.u = j
n.z = m
g.x = l
g.q = b
l.q = e
l.u = j
m.q = j
m.u = j
m.s = h
assert m.q.o.u.w.s.s.q.txt == "j"