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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: D = None
        self.x: I = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.y: D = None
        self.z: G = None
        self.o: E = None
        self.w: I = None
        self.t: H = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: I = None
        self.z: A = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.o: D = None
        self.z: G = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: D = None
        self.x: I = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.y: D = None
        self.z: G = None
        self.o: E = None
        self.w: I = None
        self.t: H = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: I = None
        self.z: A = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.o: D = None
        self.z: G = None
        self.w: C = None
        self.txt = txt

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

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

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