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

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

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

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

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

e = A("e")
l = B("l")
d = C("d")
g = D("g")
b = E("b")
h = D("h")
a = A("a")
k = C("k")
m = D("m")
j = B("j")

e.z = b
e.r = a
e.v = a
e.y = m
l.r = e
l.o = b
l.t = k
d.y = a
g.s = d
b.s = d
h.s = k
a.z = b
a.r = e
a.v = e
a.y = g
k.y = a
m.s = d
j.r = e
j.o = b
j.t = d
assert h.s.y.r.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: A = None
        self.v: A = None
        self.y: D = None
        self.txt = txt

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

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

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

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

e = A("e")
l = B("l")
d = C("d")
g = D("g")
b = E("b")
h = D("h")
a = A("a")
k = C("k")
m = D("m")
j = B("j")

e.z = b
e.r = a
e.v = a
e.y = m
l.r = e
l.o = b
l.t = k
d.y = a
g.s = d
b.s = d
h.s = k
a.z = b
a.r = e
a.v = e
a.y = g
k.y = a
m.s = d
j.r = e
j.o = b
j.t = d
assert h.s.y.r.y.s.txt == "d"