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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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