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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: G = None
        self.v: B = None
        self.u: C = None
        self.x: D = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.r: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: G = None
        self.v: B = None
        self.u: C = None
        self.x: D = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.r: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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