class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: H = None
        self.x: D = None
        self.u: H = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: G = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: C = None
        self.v: E = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.o: A = None
        self.r: D = None
        self.y: A = None
        self.txt = txt

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

k.s = g
k.p = d
k.u = d
k.x = c
k.v = f
m.s = a
f.s = c
f.p = g
f.x = h
f.y = h
c.q = e
c.x = e
c.r = f
c.v = h
c.o = i
h.q = d
h.x = e
e.s = h
e.p = g
e.t = k
g.r = f
g.s = m
d.v = g
d.z = g
d.o = k
d.y = k
d.r = i
a.s = m
i.q = e
i.x = e
i.r = f
i.v = h
i.o = c
assert i.o.o.v.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: H = None
        self.x: D = None
        self.u: H = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: G = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: C = None
        self.v: E = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.o: A = None
        self.r: D = None
        self.y: A = None
        self.txt = txt

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

k.s = g
k.p = d
k.u = d
k.x = c
k.v = f
m.s = a
f.s = c
f.p = g
f.x = h
f.y = h
c.q = e
c.x = e
c.r = f
c.v = h
c.o = i
h.q = d
h.x = e
e.s = h
e.p = g
e.t = k
g.r = f
g.s = m
d.v = g
d.z = g
d.o = k
d.y = k
d.r = i
a.s = m
i.q = e
i.x = e
i.r = f
i.v = h
i.o = c
assert i.o.o.v.x.p.txt == "g"