class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: E = None
        self.w: H = None
        self.v: D = None
        self.o: H = None
        self.x: H = None
        self.r: F = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: H = None
        self.q: H = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.z: D = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.x: E = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: F = None
        self.v: I = None
        self.z: G = None
        self.t: B = None
        self.q: A = None
        self.s: B = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: E = None
        self.w: H = None
        self.v: D = None
        self.o: H = None
        self.x: H = None
        self.r: F = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: H = None
        self.q: H = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.z: D = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.x: E = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: F = None
        self.v: I = None
        self.z: G = None
        self.t: B = None
        self.q: A = None
        self.s: B = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

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