class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: I = None
        self.r: D = None
        self.x: B = None
        self.v: I = None
        self.u: C = None
        self.y: D = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: D = None
        self.txt = txt

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

h.r = b
h.s = e
a.x = j
a.u = i
a.v = b
a.r = b
a.q = m
a.y = m
a.z = m
a.t = k
i.v = e
g.q = m
g.p = i
k.z = j
k.w = j
j.v = g
j.x = g
j.r = e
j.u = e
j.y = k
j.w = k
j.o = b
j.t = i
m.o = h
m.p = e
m.v = e
m.q = e
m.r = g
m.y = g
m.x = a
m.u = i
b.r = k
b.t = m
e.w = b
e.r = g
assert i.v.r.p.v.r.p.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: I = None
        self.r: D = None
        self.x: B = None
        self.v: I = None
        self.u: C = None
        self.y: D = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: D = None
        self.txt = txt

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

h.r = b
h.s = e
a.x = j
a.u = i
a.v = b
a.r = b
a.q = m
a.y = m
a.z = m
a.t = k
i.v = e
g.q = m
g.p = i
k.z = j
k.w = j
j.v = g
j.x = g
j.r = e
j.u = e
j.y = k
j.w = k
j.o = b
j.t = i
m.o = h
m.p = e
m.v = e
m.q = e
m.r = g
m.y = g
m.x = a
m.u = i
b.r = k
b.t = m
e.w = b
e.r = g
assert i.v.r.p.v.r.p.v.r.txt == "g"