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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: C = None
        self.p: H = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.y: C = None
        self.o: G = None
        self.t: H = None
        self.z: I = None
        self.s: I = None
        self.p: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: C = None
        self.p: H = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.y: C = None
        self.o: G = None
        self.t: H = None
        self.z: I = None
        self.s: I = None
        self.p: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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