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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: I = None
        self.s: D = None
        self.p: D = None
        self.u: B = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.p: G = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: I = None
        self.r: I = None
        self.q: F = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.p: G = None
        self.t: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: I = None
        self.s: D = None
        self.p: D = None
        self.u: B = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.p: G = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: I = None
        self.r: I = None
        self.q: F = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.p: G = None
        self.t: C = None
        self.txt = txt

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

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