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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.r: E = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: A = None
        self.s: B = None
        self.txt = txt

g = A("g")
c = B("c")
a = C("a")
e = D("e")
h = E("h")
j = F("j")
k = G("k")
m = H("m")
b = I("b")
n = J("n")

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.r: E = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: A = None
        self.s: B = None
        self.txt = txt

g = A("g")
c = B("c")
a = C("a")
e = D("e")
h = E("h")
j = F("j")
k = G("k")
m = H("m")
b = I("b")
n = J("n")

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