class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: B = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.r: B = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: A = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

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

d = A("d")
k = B("k")
g = C("g")
f = D("f")
b = E("b")
e = F("e")
n = B("n")

d.z = f
d.y = k
d.r = n
k.x = e
k.p = g
k.r = n
k.z = b
g.o = b
f.o = e
f.t = b
f.y = d
f.s = d
b.y = e
b.w = e
b.z = d
b.s = g
e.v = f
e.t = g
n.x = e
n.p = g
n.r = k
n.z = b
assert d.y.x.t.o.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: B = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.r: B = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: A = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

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

d = A("d")
k = B("k")
g = C("g")
f = D("f")
b = E("b")
e = F("e")
n = B("n")

d.z = f
d.y = k
d.r = n
k.x = e
k.p = g
k.r = n
k.z = b
g.o = b
f.o = e
f.t = b
f.y = d
f.s = d
b.y = e
b.w = e
b.z = d
b.s = g
e.v = f
e.t = g
n.x = e
n.p = g
n.r = k
n.z = b
assert d.y.x.t.o.s.o.s.txt == "g"