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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: F = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: H = None
        self.r: C = None
        self.z: C = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: F = None
        self.x: E = None
        self.w: D = None
        self.q: G = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: F = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: H = None
        self.r: C = None
        self.z: C = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: F = None
        self.x: E = None
        self.w: D = None
        self.q: G = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

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