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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.z: B = None
        self.u: H = None
        self.v: D = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: H = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.z: B = None
        self.u: H = None
        self.v: D = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: H = None
        self.p: B = None
        self.txt = txt

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

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