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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: G = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.y: E = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: G = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.y: E = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.txt = txt

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

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

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