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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.w: C = None
        self.t: D = None
        self.r: A = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: H = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: G = None
        self.r: C = None
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.w: C = None
        self.t: D = None
        self.r: A = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: H = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: G = None
        self.r: C = None
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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