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

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

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

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

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

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

b.v = e
e.s = d
n.t = b
i.t = d
i.y = j
i.x = n
i.p = n
d.x = j
d.r = b
d.v = f
d.y = f
j.v = e
f.x = j
f.r = j
f.v = d
f.y = d
m.t = f
m.y = b
m.x = n
m.p = n
assert d.v.y.r.v.s.x.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

b.v = e
e.s = d
n.t = b
i.t = d
i.y = j
i.x = n
i.p = n
d.x = j
d.r = b
d.v = f
d.y = f
j.v = e
f.x = j
f.r = j
f.v = d
f.y = d
m.t = f
m.y = b
m.x = n
m.p = n
assert d.v.y.r.v.s.x.v.s.txt == "d"