class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.y: A = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

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

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

b.p = i
b.r = j
d.s = e
d.u = j
d.z = n
j.t = f
j.p = e
j.y = i
j.v = n
j.u = b
g.r = e
g.x = d
n.u = b
f.t = j
f.p = d
f.y = i
f.v = a
f.u = b
i.p = b
i.r = f
h.r = d
h.x = e
a.u = i
e.s = d
e.u = f
e.z = n
assert h.r.s.s.u.v.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.y: A = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

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

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

b.p = i
b.r = j
d.s = e
d.u = j
d.z = n
j.t = f
j.p = e
j.y = i
j.v = n
j.u = b
g.r = e
g.x = d
n.u = b
f.t = j
f.p = d
f.y = i
f.v = a
f.u = b
i.p = b
i.r = f
h.r = d
h.x = e
a.u = i
e.s = d
e.u = f
e.z = n
assert h.r.s.s.u.v.u.r.txt == "j"