class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: G = None
        self.u: C = None
        self.p: C = None
        self.t: E = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.t: E = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: F = None
        self.x: E = None
        self.o: E = None
        self.u: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.t: E = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: F = None
        self.x: E = None
        self.o: E = None
        self.u: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.txt = txt

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

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