class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.w: E = None
        self.r: B = None
        self.o: B = None
        self.u: E = None
        self.y: E = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.v: A = None
        self.u: I = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.v: I = None
        self.z: I = None
        self.t: D = None
        self.s: I = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: B = None
        self.q: D = None
        self.o: C = None
        self.y: I = None
        self.x: D = None
        self.w: E = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.o: E = None
        self.w: H = None
        self.s: H = None
        self.t: D = None
        self.txt = txt

a = A("a")
c = B("c")
b = C("b")
f = D("f")
n = E("n")
i = F("i")
e = G("e")
d = H("d")
m = I("m")
j = A("j")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.v: A = None
        self.u: I = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.v: I = None
        self.z: I = None
        self.t: D = None
        self.s: I = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: B = None
        self.q: D = None
        self.o: C = None
        self.y: I = None
        self.x: D = None
        self.w: E = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.o: E = None
        self.w: H = None
        self.s: H = None
        self.t: D = None
        self.txt = txt

a = A("a")
c = B("c")
b = C("b")
f = D("f")
n = E("n")
i = F("i")
e = G("e")
d = H("d")
m = I("m")
j = A("j")

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