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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: B = None
        self.w: F = None
        self.s: B = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: B = None
        self.w: F = None
        self.s: B = None
        self.t: E = None
        self.txt = txt

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

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

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