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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: G = None
        self.x: B = None
        self.v: G = None
        self.p: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: G = None
        self.x: B = None
        self.v: G = None
        self.p: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

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