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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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