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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.p: A = None
        self.y: E = None
        self.q: 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.w: D = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

l = A("l")
n = B("n")
a = C("a")
j = D("j")
d = E("d")
c = B("c")
f = B("f")
h = C("h")
m = C("m")

l.s = c
l.r = c
l.z = j
n.y = l
n.w = l
n.v = j
n.x = d
a.w = l
a.p = l
a.q = l
a.v = c
a.y = d
j.s = a
d.w = j
d.r = j
d.v = l
c.y = l
c.w = l
c.v = j
c.x = d
f.y = l
f.w = l
f.v = j
f.x = d
h.w = l
h.p = l
h.q = l
h.v = n
h.y = d
m.w = l
m.p = l
m.q = l
m.v = f
m.y = d
assert c.x.w.s.v.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.p: A = None
        self.y: E = None
        self.q: 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.w: D = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

l = A("l")
n = B("n")
a = C("a")
j = D("j")
d = E("d")
c = B("c")
f = B("f")
h = C("h")
m = C("m")

l.s = c
l.r = c
l.z = j
n.y = l
n.w = l
n.v = j
n.x = d
a.w = l
a.p = l
a.q = l
a.v = c
a.y = d
j.s = a
d.w = j
d.r = j
d.v = l
c.y = l
c.w = l
c.v = j
c.x = d
f.y = l
f.w = l
f.v = j
f.x = d
h.w = l
h.p = l
h.q = l
h.v = n
h.y = d
m.w = l
m.p = l
m.q = l
m.v = f
m.y = d
assert c.x.w.s.v.y.s.txt == "c"