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

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

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

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

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

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

a = A("a")
c = B("c")
e = C("e")
m = D("m")
k = E("k")
n = F("n")

a.w = e
a.t = k
a.y = n
c.y = a
e.p = k
e.q = m
e.v = m
e.t = m
m.p = e
m.x = k
m.w = c
k.v = a
n.x = e
n.s = e
assert c.y.y.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

a = A("a")
c = B("c")
e = C("e")
m = D("m")
k = E("k")
n = F("n")

a.w = e
a.t = k
a.y = n
c.y = a
e.p = k
e.q = m
e.v = m
e.t = m
m.p = e
m.x = k
m.w = c
k.v = a
n.x = e
n.s = e
assert c.y.y.x.t.txt == "m"