class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.x: D = None
        self.r: A = None
        self.y: H = None
        self.s: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: G = None
        self.r: D = None
        self.t: I = None
        self.q: B = None
        self.z: G = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.q: F = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: F = None
        self.v: A = None
        self.s: F = None
        self.q: B = None
        self.x: E = None
        self.txt = txt

a = A("a")
h = B("h")
f = C("f")
e = D("e")
g = E("g")
k = F("k")
n = G("n")
j = H("j")
m = I("m")

a.y = m
h.v = a
h.r = a
h.o = f
h.x = e
h.y = j
h.s = m
f.t = a
f.w = j
e.v = a
e.y = a
e.u = k
e.x = m
e.t = m
e.q = f
e.w = g
g.p = n
g.v = n
g.z = n
g.r = e
g.t = m
g.q = h
g.u = h
k.p = g
k.t = f
k.q = h
k.w = e
n.p = f
n.s = a
n.q = k
n.y = m
j.y = a
j.w = n
m.r = j
m.t = k
m.s = k
m.v = a
m.q = h
m.x = g
assert a.y.x.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.x: D = None
        self.r: A = None
        self.y: H = None
        self.s: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: G = None
        self.r: D = None
        self.t: I = None
        self.q: B = None
        self.z: G = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.q: F = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: F = None
        self.v: A = None
        self.s: F = None
        self.q: B = None
        self.x: E = None
        self.txt = txt

a = A("a")
h = B("h")
f = C("f")
e = D("e")
g = E("g")
k = F("k")
n = G("n")
j = H("j")
m = I("m")

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