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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: A = None
        self.y: A = None
        self.q: D = None
        self.r: D = None
        self.x: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: A = None
        self.y: A = None
        self.q: D = None
        self.r: D = None
        self.x: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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