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

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

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

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

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

f = A("f")
a = B("a")
n = C("n")
m = D("m")
g = E("g")
l = A("l")
e = B("e")

f.w = g
f.x = e
a.p = e
a.r = l
n.v = m
n.q = m
n.r = m
n.x = a
n.w = a
m.r = l
m.y = a
g.u = l
g.v = l
g.p = l
g.s = n
l.w = g
l.x = a
e.p = a
e.r = f
assert m.r.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

f = A("f")
a = B("a")
n = C("n")
m = D("m")
g = E("g")
l = A("l")
e = B("e")

f.w = g
f.x = e
a.p = e
a.r = l
n.v = m
n.q = m
n.r = m
n.x = a
n.w = a
m.r = l
m.y = a
g.u = l
g.v = l
g.p = l
g.s = n
l.w = g
l.x = a
e.p = a
e.r = f
assert m.r.w.s.txt == "n"