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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.t: A = None
        self.u: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: I = None
        self.p: I = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: C = None
        self.y: A = None
        self.z: C = None
        self.r: I = None
        self.p: A = None
        self.s: C = None
        self.u: H = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.y: G = None
        self.o: D = None
        self.v: B = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: H = None
        self.r: D = None
        self.z: F = None
        self.t: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.t: A = None
        self.u: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: I = None
        self.p: I = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: C = None
        self.y: A = None
        self.z: C = None
        self.r: I = None
        self.p: A = None
        self.s: C = None
        self.u: H = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.y: G = None
        self.o: D = None
        self.v: B = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: H = None
        self.r: D = None
        self.z: F = None
        self.t: B = None
        self.txt = txt

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

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