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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.s: I = None
        self.r: G = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: G = None
        self.u: A = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.z: E = None
        self.p: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.s: I = None
        self.r: G = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: G = None
        self.u: A = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.z: E = None
        self.p: H = None
        self.txt = txt

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

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