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

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

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

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

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

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

h.u = f
h.r = f
h.w = a
e.w = m
e.v = a
e.r = h
e.y = j
e.o = f
g.y = f
g.w = n
m.o = f
m.r = a
m.p = e
a.t = f
a.w = e
a.p = j
n.y = f
n.w = g
f.o = m
f.r = j
f.p = e
d.u = f
d.w = a
d.r = m
j.t = m
j.w = e
j.p = a
assert d.w.w.w.r.t.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

h.u = f
h.r = f
h.w = a
e.w = m
e.v = a
e.r = h
e.y = j
e.o = f
g.y = f
g.w = n
m.o = f
m.r = a
m.p = e
a.t = f
a.w = e
a.p = j
n.y = f
n.w = g
f.o = m
f.r = j
f.p = e
d.u = f
d.w = a
d.r = m
j.t = m
j.w = e
j.p = a
assert d.w.w.w.r.t.r.p.txt == "a"