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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: C = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

a.s = b
a.o = b
a.y = k
g.q = k
g.t = k
g.x = c
g.p = l
c.x = g
k.t = c
b.t = c
b.u = a
l.z = g
l.o = b
assert c.x.p.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: C = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

a.s = b
a.o = b
a.y = k
g.q = k
g.t = k
g.x = c
g.p = l
c.x = g
k.t = c
b.t = c
b.u = a
l.z = g
l.o = b
assert c.x.p.z.t.txt == "k"