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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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