class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: D = None
        self.q: C = None
        self.t: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

b.x = f
b.t = f
b.w = g
b.q = n
b.z = j
d.w = f
a.y = f
f.t = d
f.w = d
f.p = a
f.v = g
f.q = g
i.v = l
i.p = l
i.t = e
i.y = d
j.x = g
j.w = g
j.q = n
j.t = f
j.z = b
g.t = d
g.w = d
g.p = e
g.v = f
g.q = f
e.y = g
n.y = f
l.v = i
l.p = i
l.t = a
l.y = d
assert i.y.w.v.q.w.w.p.y.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: D = None
        self.q: C = None
        self.t: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

b.x = f
b.t = f
b.w = g
b.q = n
b.z = j
d.w = f
a.y = f
f.t = d
f.w = d
f.p = a
f.v = g
f.q = g
i.v = l
i.p = l
i.t = e
i.y = d
j.x = g
j.w = g
j.q = n
j.t = f
j.z = b
g.t = d
g.w = d
g.p = e
g.v = f
g.q = f
e.y = g
n.y = f
l.v = i
l.p = i
l.t = a
l.y = d
assert i.y.w.v.q.w.w.p.y.q.q.txt == "f"