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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: E = None
        self.z: I = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.y: H = None
        self.w: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: F = None
        self.v: E = None
        self.s: A = None
        self.z: A = None
        self.u: F = None
        self.p: I = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: E = None
        self.z: I = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.y: H = None
        self.w: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: F = None
        self.v: E = None
        self.s: A = None
        self.z: A = None
        self.u: F = None
        self.p: I = None
        self.x: A = None
        self.txt = txt

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

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

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