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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: E = None
        self.y: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: E = None
        self.txt = txt

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

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

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

i.w = f
c.z = b
c.r = g
m.x = i
m.p = h
m.y = f
d.w = k
d.x = f
d.z = f
d.s = c
d.v = h
d.t = i
d.p = m
h.x = d
h.q = d
h.t = c
b.x = f
f.x = k
f.z = h
k.r = d
k.o = d
k.x = m
k.q = m
k.s = b
k.v = g
k.w = i
g.u = h
g.t = d
g.r = c
g.w = c
g.q = m
assert c.r.q.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: E = None
        self.y: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: E = None
        self.txt = txt

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

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

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

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