class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.u: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.u: C = None
        self.r: D = None
        self.txt = txt

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

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

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