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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

f = A("f")
g = B("g")
k = C("k")
a = D("a")
i = E("i")
d = F("d")
m = G("m")

f.t = a
f.x = a
f.v = a
f.s = d
g.v = d
g.s = d
g.x = f
g.o = k
g.z = m
k.v = m
k.o = m
k.s = d
a.s = f
a.z = g
a.o = d
i.w = k
i.t = f
i.s = f
i.z = f
d.o = m
d.u = f
d.x = g
m.y = d
assert d.x.x.s.o.y.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.v: D = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

f = A("f")
g = B("g")
k = C("k")
a = D("a")
i = E("i")
d = F("d")
m = G("m")

f.t = a
f.x = a
f.v = a
f.s = d
g.v = d
g.s = d
g.x = f
g.o = k
g.z = m
k.v = m
k.o = m
k.s = d
a.s = f
a.z = g
a.o = d
i.w = k
i.t = f
i.s = f
i.z = f
d.o = m
d.u = f
d.x = g
m.y = d
assert d.x.x.s.o.y.u.s.txt == "d"