class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: F = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.o: B = None
        self.v: C = None
        self.u: C = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: D = None
        self.z: E = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

f.q = a
f.r = j
e.q = i
e.v = g
e.u = f
e.x = f
e.t = h
h.u = n
h.p = f
j.s = n
j.z = n
j.o = a
j.q = f
n.q = j
n.p = f
n.o = g
n.v = d
n.u = d
n.s = b
a.u = n
a.z = n
a.r = j
a.w = j
a.p = e
b.s = n
b.z = n
b.o = a
b.q = f
g.q = e
g.v = e
g.u = f
g.x = f
g.t = h
d.u = n
d.p = f
i.q = e
i.v = g
i.u = f
i.x = f
i.t = d
assert h.p.q.w.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: F = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.o: B = None
        self.v: C = None
        self.u: C = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: D = None
        self.z: E = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

f.q = a
f.r = j
e.q = i
e.v = g
e.u = f
e.x = f
e.t = h
h.u = n
h.p = f
j.s = n
j.z = n
j.o = a
j.q = f
n.q = j
n.p = f
n.o = g
n.v = d
n.u = d
n.s = b
a.u = n
a.z = n
a.r = j
a.w = j
a.p = e
b.s = n
b.z = n
b.o = a
b.q = f
g.q = e
g.v = e
g.u = f
g.x = f
g.t = h
d.u = n
d.p = f
i.q = e
i.v = g
i.u = f
i.x = f
i.t = d
assert h.p.q.w.o.u.txt == "n"