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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.u: H = None
        self.o: D = None
        self.r: I = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.o: A = None
        self.w: D = None
        self.u: A = None
        self.p: I = None
        self.q: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.u: H = None
        self.o: D = None
        self.r: I = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.o: A = None
        self.w: D = None
        self.u: A = None
        self.p: I = None
        self.q: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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