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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

m.s = b
m.y = j
m.r = d
m.u = a
b.w = l
b.v = d
b.p = j
d.z = m
a.w = m
l.o = d
l.w = m
l.y = m
l.u = m
j.o = d
j.w = m
j.y = m
j.u = m
i.w = l
i.v = g
i.p = j
g.z = m
assert g.z.r.z.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: E = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

m.s = b
m.y = j
m.r = d
m.u = a
b.w = l
b.v = d
b.p = j
d.z = m
a.w = m
l.o = d
l.w = m
l.y = m
l.u = m
j.o = d
j.w = m
j.y = m
j.u = m
i.w = l
i.v = g
i.p = j
g.z = m
assert g.z.r.z.s.v.txt == "d"