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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: F = None
        self.z: A = None
        self.w: E = None
        self.y: H = None
        self.x: D = None
        self.o: B = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: I = None
        self.o: B = None
        self.p: E = None
        self.r: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: F = None
        self.z: A = None
        self.w: E = None
        self.y: H = None
        self.x: D = None
        self.o: B = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: I = None
        self.o: B = None
        self.p: E = None
        self.r: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.txt = txt

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

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