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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: A = None
        self.o: E = None
        self.w: B = None
        self.txt = txt

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

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

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

a = A("a")
d = B("d")
b = C("b")
k = D("k")
j = E("j")
l = F("l")
g = F("g")

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: A = None
        self.o: E = None
        self.w: B = None
        self.txt = txt

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

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

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

a = A("a")
d = B("d")
b = C("b")
k = D("k")
j = E("j")
l = F("l")
g = F("g")

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