class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: C = None
        self.s: B = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.w: D = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.w: D = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.txt = txt

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

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