class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.z: B = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: C = None
        self.x: C = None
        self.v: 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.r: E = None
        self.x: B = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

j = A("j")
g = B("g")
c = C("c")
l = D("l")
h = E("h")
e = D("e")
m = B("m")
f = A("f")

j.w = g
j.p = g
j.z = m
j.y = m
j.q = c
g.u = j
g.t = c
g.x = c
g.v = c
c.y = f
l.r = h
l.x = g
l.s = j
l.p = c
h.s = e
e.r = h
e.x = g
e.s = j
e.p = c
m.u = f
m.t = c
m.x = c
m.v = c
f.w = m
f.p = g
f.z = g
f.y = g
f.q = c
assert f.w.u.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.z: B = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: C = None
        self.x: C = None
        self.v: 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.r: E = None
        self.x: B = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

j = A("j")
g = B("g")
c = C("c")
l = D("l")
h = E("h")
e = D("e")
m = B("m")
f = A("f")

j.w = g
j.p = g
j.z = m
j.y = m
j.q = c
g.u = j
g.t = c
g.x = c
g.v = c
c.y = f
l.r = h
l.x = g
l.s = j
l.p = c
h.s = e
e.r = h
e.x = g
e.s = j
e.p = c
m.u = f
m.t = c
m.x = c
m.v = c
f.w = m
f.p = g
f.z = g
f.y = g
f.q = c
assert f.w.u.q.y.txt == "f"