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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: A = None
        self.p: H = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: A = None
        self.p: H = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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