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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.r: C = None
        self.o: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.r: C = None
        self.o: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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