class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: A = None
        self.x: D = None
        self.w: D = None
        self.r: G = None
        self.s: D = None
        self.txt = txt

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

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

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

f.y = i
f.t = m
f.z = b
i.u = f
i.v = b
i.o = b
i.p = a
i.z = k
m.z = b
m.v = f
m.u = k
m.s = i
m.r = i
m.x = i
m.y = a
k.t = j
j.t = k
j.x = k
j.w = k
j.s = k
j.z = f
j.r = a
b.y = j
b.z = i
a.x = j
a.w = m
assert a.w.z.z.u.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: A = None
        self.x: D = None
        self.w: D = None
        self.r: G = None
        self.s: D = None
        self.txt = txt

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

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

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

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