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

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

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

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

e = A("e")
c = B("c")
a = C("a")
l = D("l")
f = D("f")
g = D("g")
n = B("n")
d = B("d")

e.s = d
e.x = g
c.y = g
c.p = e
c.r = a
a.v = e
a.t = n
l.w = a
l.v = n
l.y = g
f.w = a
f.v = n
f.y = l
g.w = a
g.v = n
g.y = f
n.y = g
n.p = e
n.r = a
d.y = g
d.p = e
d.r = a
assert e.x.w.v.s.y.w.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
a = C("a")
l = D("l")
f = D("f")
g = D("g")
n = B("n")
d = B("d")

e.s = d
e.x = g
c.y = g
c.p = e
c.r = a
a.v = e
a.t = n
l.w = a
l.v = n
l.y = g
f.w = a
f.v = n
f.y = l
g.w = a
g.v = n
g.y = f
n.y = g
n.p = e
n.r = a
d.y = g
d.p = e
d.r = a
assert e.x.w.v.s.y.w.t.r.txt == "a"