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

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

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

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

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

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

m.v = i
m.q = a
a.p = k
a.q = i
a.x = i
a.w = m
a.u = m
b.q = a
b.v = k
c.t = h
c.u = m
c.x = d
c.p = a
c.q = a
i.t = j
i.x = m
i.q = m
i.w = m
h.q = a
h.v = k
d.t = h
d.u = m
d.x = j
d.p = k
d.q = k
k.p = a
k.q = i
k.x = i
k.w = m
k.u = m
j.t = b
j.u = m
j.x = d
j.p = k
j.q = a
assert a.p.w.v.t.x.x.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

m.v = i
m.q = a
a.p = k
a.q = i
a.x = i
a.w = m
a.u = m
b.q = a
b.v = k
c.t = h
c.u = m
c.x = d
c.p = a
c.q = a
i.t = j
i.x = m
i.q = m
i.w = m
h.q = a
h.v = k
d.t = h
d.u = m
d.x = j
d.p = k
d.q = k
k.p = a
k.q = i
k.x = i
k.w = m
k.u = m
j.t = b
j.u = m
j.x = d
j.p = k
j.q = a
assert a.p.w.v.t.x.x.p.w.txt == "m"