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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: G = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: I = None
        self.z: F = None
        self.r: B = None
        self.u: B = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: D = None
        self.z: E = None
        self.v: D = None
        self.u: B = None
        self.w: D = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: G = None
        self.p: D = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: H = None
        self.p: H = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

g.v = d
g.y = h
e.o = j
e.x = c
e.p = c
e.q = h
i.v = d
i.p = k
i.o = e
h.s = e
h.r = e
h.u = e
h.x = j
h.z = k
h.q = k
n.u = g
n.p = j
k.x = g
k.t = c
c.y = j
c.t = h
c.v = h
c.w = h
c.z = n
c.u = e
c.x = g
d.u = c
d.z = c
d.p = h
d.o = g
d.s = i
j.r = d
j.t = d
j.p = d
j.s = e
j.w = e
assert d.p.x.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: G = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: I = None
        self.z: F = None
        self.r: B = None
        self.u: B = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: D = None
        self.z: E = None
        self.v: D = None
        self.u: B = None
        self.w: D = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: G = None
        self.p: D = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: H = None
        self.p: H = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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