class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

g.x = b
g.t = d
f.q = e
f.y = a
f.s = b
f.w = m
i.q = b
i.t = f
i.y = j
e.u = j
e.t = f
e.s = i
e.w = d
d.q = g
j.q = e
j.y = e
j.s = b
j.w = m
a.u = j
a.t = f
a.s = b
a.w = d
b.q = i
b.t = f
b.y = f
m.u = f
m.t = f
m.s = i
m.w = d
assert j.q.w.q.t.q.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

g.x = b
g.t = d
f.q = e
f.y = a
f.s = b
f.w = m
i.q = b
i.t = f
i.y = j
e.u = j
e.t = f
e.s = i
e.w = d
d.q = g
j.q = e
j.y = e
j.s = b
j.w = m
a.u = j
a.t = f
a.s = b
a.w = d
b.q = i
b.t = f
b.y = f
m.u = f
m.t = f
m.s = i
m.w = d
assert j.q.w.q.t.q.x.y.txt == "f"