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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.x: C = None
        self.s: G = None
        self.w: B = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.v: D = None
        self.r: H = None
        self.y: A = None
        self.q: H = None
        self.s: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: G = None
        self.y: F = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: A = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.x: C = None
        self.s: G = None
        self.w: B = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.v: D = None
        self.r: H = None
        self.y: A = None
        self.q: H = None
        self.s: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: G = None
        self.y: F = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: A = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

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