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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: I = None
        self.s: F = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: F = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.r: A = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.v: B = None
        self.w: A = None
        self.o: I = None
        self.t: A = None
        self.p: I = None
        self.r: E = None
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: A = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: I = None
        self.s: F = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: F = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.r: A = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.v: B = None
        self.w: A = None
        self.o: I = None
        self.t: A = None
        self.p: I = None
        self.r: E = None
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: A = None
        self.p: B = None
        self.txt = txt

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

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