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

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

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

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

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

j = A("j")
e = B("e")
d = C("d")
f = D("f")
m = E("m")
n = A("n")

j.p = m
j.w = f
j.t = f
j.q = f
j.v = n
e.s = j
d.r = n
d.u = j
d.v = f
d.q = e
f.q = e
f.u = e
f.z = m
f.x = m
m.r = n
m.w = f
n.p = m
n.w = f
n.t = f
n.q = f
n.v = j
assert e.s.v.q.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.t: D = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
d = C("d")
f = D("f")
m = E("m")
n = A("n")

j.p = m
j.w = f
j.t = f
j.q = f
j.v = n
e.s = j
d.r = n
d.u = j
d.v = f
d.q = e
f.q = e
f.u = e
f.z = m
f.x = m
m.r = n
m.w = f
n.p = m
n.w = f
n.t = f
n.q = f
n.v = j
assert e.s.v.q.q.s.txt == "j"