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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: E = None
        self.u: D = None
        self.s: G = None
        self.q: A = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: E = None
        self.u: D = None
        self.s: G = None
        self.q: A = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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