class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.x: G = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.t: F = None
        self.r: D = None
        self.z: D = None
        self.p: D = None
        self.w: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.u: B = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.t: F = None
        self.r: D = None
        self.z: D = None
        self.p: D = None
        self.w: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.u: B = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

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

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