class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.y: D = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.r: E = None
        self.t: A = None
        self.x: B = None
        self.txt = txt

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

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

j = A("j")
d = B("d")
n = C("n")
i = D("i")
a = E("a")
h = B("h")

j.q = n
j.s = a
j.y = i
j.o = i
d.s = n
d.w = i
n.p = j
n.t = j
n.s = d
n.r = a
n.x = h
i.t = d
a.w = h
a.u = h
a.v = n
h.s = n
h.w = i
assert a.v.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.y: D = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.r: E = None
        self.t: A = None
        self.x: B = None
        self.txt = txt

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

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

j = A("j")
d = B("d")
n = C("n")
i = D("i")
a = E("a")
h = B("h")

j.q = n
j.s = a
j.y = i
j.o = i
d.s = n
d.w = i
n.p = j
n.t = j
n.s = d
n.r = a
n.x = h
i.t = d
a.w = h
a.u = h
a.v = n
h.s = n
h.w = i
assert a.v.r.v.txt == "n"