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

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

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

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

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

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

b.x = d
b.s = m
b.v = e
b.y = c
k.w = e
a.u = e
a.p = f
a.y = f
a.s = b
a.x = j
d.u = f
d.y = a
d.v = j
d.q = e
f.y = m
h.w = d
e.u = f
e.y = j
e.v = a
e.q = d
c.x = e
c.s = m
c.y = m
c.v = d
m.x = d
m.s = c
m.y = c
m.v = e
j.u = e
j.p = f
j.y = f
j.s = c
j.x = a
assert m.y.x.q.v.s.v.y.x.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: A = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

b.x = d
b.s = m
b.v = e
b.y = c
k.w = e
a.u = e
a.p = f
a.y = f
a.s = b
a.x = j
d.u = f
d.y = a
d.v = j
d.q = e
f.y = m
h.w = d
e.u = f
e.y = j
e.v = a
e.q = d
c.x = e
c.s = m
c.y = m
c.v = d
m.x = d
m.s = c
m.y = c
m.v = e
j.u = e
j.p = f
j.y = f
j.s = c
j.x = a
assert m.y.x.q.v.s.v.y.x.p.y.txt == "m"