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

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

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

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

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

j = A("j")
c = B("c")
h = C("h")
e = D("e")
f = E("f")
n = C("n")
a = E("a")
i = B("i")
m = B("m")

j.r = e
j.u = m
j.x = m
j.q = a
j.p = a
c.s = m
c.u = m
c.q = f
c.x = e
h.y = i
h.z = i
h.x = f
e.o = a
e.t = a
e.q = m
e.w = j
f.w = a
f.o = i
f.z = i
n.y = m
n.z = m
n.x = f
a.w = f
a.o = i
a.z = i
i.s = m
i.u = m
i.q = f
i.x = e
m.s = c
m.u = i
m.q = a
m.x = e
assert a.o.x.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.q: E = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

j = A("j")
c = B("c")
h = C("h")
e = D("e")
f = E("f")
n = C("n")
a = E("a")
i = B("i")
m = B("m")

j.r = e
j.u = m
j.x = m
j.q = a
j.p = a
c.s = m
c.u = m
c.q = f
c.x = e
h.y = i
h.z = i
h.x = f
e.o = a
e.t = a
e.q = m
e.w = j
f.w = a
f.o = i
f.z = i
n.y = m
n.z = m
n.x = f
a.w = f
a.o = i
a.z = i
i.s = m
i.u = m
i.q = f
i.x = e
m.s = c
m.u = i
m.q = a
m.x = e
assert a.o.x.o.w.txt == "f"