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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: E = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: F = None
        self.y: B = None
        self.t: E = None
        self.p: H = None
        self.txt = txt

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

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

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

m.q = a
m.v = f
d.s = l
h.r = l
c.p = f
c.v = g
c.u = d
c.x = d
g.t = m
g.z = h
a.p = l
a.s = l
a.w = c
a.x = g
a.q = d
a.u = d
a.z = n
a.r = h
n.v = d
n.y = d
n.x = k
n.t = g
n.p = f
f.z = c
f.x = m
l.y = g
l.r = g
l.z = f
k.p = l
k.s = l
k.w = c
k.x = g
k.q = d
k.u = d
k.z = n
k.r = h
assert n.t.t.v.z.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: E = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: F = None
        self.y: B = None
        self.t: E = None
        self.p: H = None
        self.txt = txt

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

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

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

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