class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.t: B = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: C = None
        self.u: C = None
        self.o: C = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: G = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.q: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: C = None
        self.u: C = None
        self.o: C = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: G = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.q: A = None
        self.txt = txt

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

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

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