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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.u: H = None
        self.z: B = None
        self.w: A = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: A = None
        self.q: G = None
        self.v: H = None
        self.z: H = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.u: H = None
        self.z: B = None
        self.w: A = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: A = None
        self.q: G = None
        self.v: H = None
        self.z: H = None
        self.o: A = None
        self.txt = txt

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

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

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