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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.txt = txt

g = A("g")
a = B("a")
e = C("e")
f = D("f")
d = E("d")
k = A("k")
c = A("c")
m = D("m")
i = C("i")
h = B("h")

g.y = d
a.w = h
a.s = i
e.x = m
e.r = m
e.t = i
e.s = d
f.t = d
f.p = m
f.v = k
d.x = i
d.u = m
k.y = d
c.y = d
m.t = d
m.p = f
m.v = g
i.x = m
i.r = m
i.t = e
i.s = d
h.w = a
h.s = i
assert g.y.x.r.t.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.txt = txt

g = A("g")
a = B("a")
e = C("e")
f = D("f")
d = E("d")
k = A("k")
c = A("c")
m = D("m")
i = C("i")
h = B("h")

g.y = d
a.w = h
a.s = i
e.x = m
e.r = m
e.t = i
e.s = d
f.t = d
f.p = m
f.v = k
d.x = i
d.u = m
k.y = d
c.y = d
m.t = d
m.p = f
m.v = g
i.x = m
i.r = m
i.t = e
i.s = d
h.w = a
h.s = i
assert g.y.x.r.t.x.r.txt == "m"