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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.x: C = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.x: C = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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