class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.o: A = None
        self.w: B = None
        self.y: F = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.o: A = None
        self.w: B = None
        self.y: F = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

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

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