class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: C = None
        self.t: B = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: B = None
        self.q: E = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.s: B = None
        self.r: H = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

g.x = e
g.r = e
g.o = l
g.t = f
f.q = d
l.r = m
l.x = m
l.p = e
l.w = d
l.o = k
l.s = g
l.u = f
l.v = f
d.y = h
d.x = f
d.q = k
d.v = k
d.s = k
k.o = e
k.q = e
k.s = f
k.r = h
k.y = g
k.u = l
e.x = h
e.r = g
e.z = l
e.p = l
e.s = m
e.v = k
m.w = h
h.y = l
h.s = l
h.p = g
h.v = f
assert g.r.z.p.r.t.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: C = None
        self.t: B = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: B = None
        self.q: E = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.s: B = None
        self.r: H = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

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